Question: 4.) r the following MIPS assembly code segment for implementing a while loop: Loop: add Stl, Stl, Ss instruction type: addressing mode lw $12, 4(Stl)
r the following MIPS assembly code segment for implementing a while loop: Loop: add Stl, Stl, Ss instruction type: addressing mode lw $12, 4(Stl) instruc bne $12, Ss2, Done instruction type: addre addi Ss1, Ss1,4 type: j Loop tion type: addressing mode type.addressing mode: type: addressing mode instruction . instruction Done: (o) Write the instruction type and addressing mode used in each instruction above. (b) Write the MIPS machine code for the 1st instruction, ie, add $t1, $t1, $s1, in hex number. Opcode/func for add are 0/32 in decimal; register numbers for Stl and Ssl are 9 and 17 in decimal. C) Write the MIPS machine code for the 3rd instruction, i.., bne $12, $s2, Done, inhex number. Opcode for bne is 5 in decimal; register numbers for $12 and Ss2 are 10 and 18 in decimal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
