Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started