Consider the following MIPS code (don\'t worry about what it does): loop: beq $s
ID: 3785426 • Letter: C
Question
Consider the following MIPS code (don't worry about what it does): loop: beq $s0, $s1, done addi $t0, $t0, 7 addi $t1, $t2, 4 addi $s0, $s0, 1 j loop done: beq $t1, $t5, skip addi $t0, $t0, 1 add $t1, $t2, $t0 skip addi $t5, $0, 10 beq $t1, $t5, done j end Compute the branch offset for each beq in number of words away from the branch (e.g., "branch offset is 2"). Assume label loop is at location 0times00114214 and label end is at location 0times00032794. Compute the correct value to place in the jump address field for each jump instruction in the MIPS code above.Explanation / Answer
a . The branch offset is a 16 bit address , For the first beq instruction branch off set is 1 , given by 0000 0000 0000 0001
For second beq instruction offset is 6 , given by 0000 0000 0000 0110
For third beq instruction branch offset is 6 , given by 0000 0000 0000 0110
b. The jump address of first jump is 0x00114228 and jump address of second jump is 0x00032794
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.