Question: For these problems, the table holds MIPS assembly code fragments. You will be asked to evaluate each of the code fragments, familiarizing you with the
For these problems, the table holds MIPS assembly code fragments. You will be asked to evaluate each of the code fragments, familiarizing you with the different MIPS branch instructions.
For the loops written in MIPS assembly above, assume that the register $t1 is initialized to the value 10. What is the value in register $s2 assuming the $s2 is initially zero?
a. b. LOOP: addi $s2, $s2, 2 subi $t1, $t1, 1 bne $t1, $0. LOOP DONE: LOOP: DONE: $t1 slt $t2, $0, beq $t2, $0, DONE subi $t1, $t1, 1 addi $s2, $s2, 2 j LOOP
Step by Step Solution
3.40 Rating (163 Votes )
There are 3 Steps involved in it
To determine the value in register s2 assuming it is initially zero we can step through the loop cod... View full answer
Get step-by-step solutions from verified subject matter experts
