Question: Consider the following MIPS assembly code: lw $t 1 , &a lw $t 2 , &b mul $t 3 , $t 1 , $t 2

Consider the following MIPS assembly code:
lw $t1, &a
lw $t2, &b
mul $t3, $t1, $t2
L1:
bne $t1, $t2, L2
j exit
L2:
bgt $t1, $t2, L3
sub $t2, $t2, $t1
j L1
L3:
sub $t1, $t1, $t2
j L1
exit:
div $t3, $t3, $t1
sw $t3, &c
Assuming initial values of a =9 and b =15, what will be the value of c when the code completes its execution?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!