Question: 5.3 Rewrite the following program fragment that is written using the GPR instruction set for execution on a CISC processor that provides the same

 

5.3 Rewrite the following program fragment that is written using the GPR instruction set for execution on a CISC processor that provides the same instruction set as the GPR processor but allows the register addressing mode to be used on the input operands or destination of any instruction. (Yes, the code fragment will execute correctly as written on such a processor. Your goal should be to reduce the number of instructions as much as possible.) Assume that the program ends after the last instruction in the fragment, so that the only goal of the program should be to have the correct value written into memory at the end. LD r1, (r2) LD r3, (r4) LD r5, (r6) LD r7, (r8) DIV r9, r1, r3 ADD r10, r9, r5 SUB r11, r7, r10 ST (r12), r11

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The following code is written by assuming the r2 r4 r6 r8 and r12 contents are decimal values as ... View full answer

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