Question: 4. Consider the following MIPS assembly code segment for implementing a while loop. Start: add $t1, $s2, $s1 instruction type: addressing mode: lw $t0, 4($t1)

 4. Consider the following MIPS assembly code segment for implementing a

4. Consider the following MIPS assembly code segment for implementing a while loop. Start: add $t1, $s2, $s1 instruction type: addressing mode: lw $t0, 4($t1) instruction type: addressing mode: bne $t0, $s5, End instruction type: addressing mode: addi $s1, $s1, 2 instruction type: addressing mode: subi $s1, $sl, 1 instruction type: addressing mode: j Start instruction type: addressing mode: End: (a) Specify the instruction type and addressing mode used in each instruction above. (b) Write MIPS machine code for the 2nd instruction (lw) in Hex number. Opcode for lw is 35 in decimal; register numbers for $t0 and $t1 are 8 and 9 in decimal, respectively. (c) Write MIPS machine code for the 3rd instruction (bne) in Hex number. Opcode for bne is 5 in decimal; register number for $s5 is 21 in decimal

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 Databases Questions!