& main:
li $s0, 5& #load 5 into register s0
li $s1, 4& #load 4 into register s1
MULTIPLY:
li $s3, 1& #counter to control how many times we go through loop
add $s4, $s0, $s4
add $s5, $s3, $s5
bne $s5, $s1, MULTIPLY& #if control and s1 aren't equal re-enter loop
j EXIT #otherwise jump to EXIT
EXIT:
li $v0, 1
la $a0, ($s4)
syscall & #system call to print out result
jr $31 #end program
Comments
You're welcome. We are glad to be helpful. If you really liked our service please press like-button beside answer field. Thank you!
tanks alot
Leave a comment