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.
Translate the loops above into C. Assume that the C-level integer i is held in register $t1, $s2 holds the C-level integer called result, and $s0 holds the base address of the integer MemArray.
a. b. addi $t1, $0.50 LOOP: lw $s1, 0($50) add $s2, $s2, $sl lw $s1, 4($50) add $s2, $s2, $sl addi $50, $50, 8 subi $t1, $t1, 1 bne $t1, $0, LOOP addi $t1, $0, $0 $s1, 0($50) add $s2, $s2, $sl addi $50, $50, 4 addi $t1, $t1, 1 slti $t2, $t1, 100 bne $t2, $50, LOOP LOOP: lw
Step by Step Solution
3.46 Rating (156 Votes )
There are 3 Steps involved in it
Lets translate the MIPS assembly code fragments into equivalent ... View full answer
Get step-by-step solutions from verified subject matter experts
