Load the following program into LC3 Simulator (You need to first use LC3 Edit be
ID: 3913352 • Letter: L
Question
Load the following program into LC3 Simulator (You need to first use LC3 Edit before loading the program into the simulator) 1. 0001 0000 0000 0000 0001 010 000 1 00101 0001 011 000 1 00110 0001 010 000 0 00 010 0001 000 010 0 00 011 Put a breakpoint after the last instruction of the program (as described in LC3-WinGuide) and execute the progranm What are the contents of the following registers (in hex), when the program stops at the breakpoint: 2. 3. R2- R3- Change the program counter to the address of the first instruction in the program and execute the program 4. RO- R2- R3- 5. Clearly the contents of the registers RO, R2 and R3 are different from the contents in part 3. Why? How would you change the program so that it will produce the same results (Register contents you observed in step 3) every time the program is run. 6.Explanation / Answer
Though I am including the answer the problem was for you to learn the lc3 simulator. I heavily encourage you to do this on your own so that you have the required understanding.
Answer 3: R0 = 0x0000, R2 = 0x0005, R3 = 0x0006
Answer 4: R0 = 0x7FFF, R2 = 0x0005, R3 = 0x0006
Answer 5: The answer is different as the PC is moved to the begining of the program after hitting the breakpoint. The initialization of R0,R2 and R3 is different when it restarts from the breakpoint and when it starts from scratch
Answer 6: The program should be changed so that before starting the computation, it should initialize values in R2, R0 and R3 to desired values, so that it operates on the same values whether it starts from scratch or is made to restart.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.