Question: 6) [20 points] C code: While (save[i] == k) { ... // long instruction sequence... i += 1; } This while loop example from the
6) [20 points]
C code:
While (save[i] == k) {
... // long instruction sequence...
i += 1; }
This while loop example from the textbook has been modified by inserting a large sequence of instructions inside the while loop as shown in the table. As a result, the beginning instruction of the loop is far away (address: 70000, instead of 80000) from the beq at the end of the loop. You are asked to make a correction to the beq instruction. You need to explain the reason why beq can no longer work. You are requested to replace the beq instruction with another instruction to accomplish the long jump. You also need to make the correct machine code! You must explain how you assemble every bit in the machine code of the new instruction.
![6) [20 points] C code: While (save[i] == k) { ... //](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f312485a0b1_95966f31247efccf.jpg)
Page
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
