Question: 5. (20 points) Consider the following MIPS loop: LOOP: slt $t0, $ 0, $50 beg $t0, $0, DONE subi $0, $50, 1 sll $t0, $s0,
5. (20 points) Consider the following MIPS loop: LOOP: slt $t0, $ 0, $50 beg $t0, $0, DONE subi $0, $50, 1 sll $t0, $s0, 2 add $t0, $t0, $s1 lw $t1, 0 ($t0) addi $t1, $t1, 1 SW $t1, 0 ($t0) LOOP DONE: Register allocations - i $s0 - base of A[] $s1 temporaries $t0 - ti 5.1. (15 points) Translate above assembly code to C code. 5.2. (5 points) If variable i ($80) is initialized to the value n, how many instructions are executed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
