Guest User

Untitled

a guest
Sep 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. .text
  2.  
  3. main:
  4.  
  5. li $s0,1 # A= 1
  6. li $s1,2 # B= 2
  7. li $s2,3 # C= 3
  8. li $s3,4 # D= 4
  9.  
  10. BNE $s0 , $s1,else # if (A!=B)
  11. add $s2,$s2,$s3 # C= C + D
  12.  
  13. # let to print the result
  14. li $v0,1
  15. move $a0,$s2
  16. syscall
  17.  
  18. j EXIT # Jump to the label Exit
  19.  
  20. else: sub $s1,$s2,$s3 # B = C - D
  21. # let to print the result
  22. li $v0,1
  23. move $a0,$s1
  24. syscall
  25. EXIT:
  26. # Make the interruption in Mips Assembl
  27. li $v0,10
  28. syscall
Add Comment
Please, Sign In to add comment