Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- main:
- li $s0,1 # A= 1
- li $s1,2 # B= 2
- li $s2,3 # C= 3
- li $s3,4 # D= 4
- BNE $s0 , $s1,else # if (A!=B)
- add $s2,$s2,$s3 # C= C + D
- # let to print the result
- li $v0,1
- move $a0,$s2
- syscall
- j EXIT # Jump to the label Exit
- else: sub $s1,$s2,$s3 # B = C - D
- # let to print the result
- li $v0,1
- move $a0,$s1
- syscall
- EXIT:
- # Make the interruption in Mips Assembl
- li $v0,10
- syscall
Add Comment
Please, Sign In to add comment