Question: LC3 Please help with part A and B (6 points) Consider the following code. Assuming all registers start at zero, what is the output of
(6 points) Consider the following code. Assuming all registers start at zero, what is the output of the program? Be exact! This question is tricky in several places. Take your time. Clearly keep track of what values are in RO and R2 as the program executes (not all boxes are needed). a. "ORIG x3000 RO: 000N LEA LD OUT LEA PUTS STI TRAP HALT RO, THING RO, LABEL -Prins R2, BLAH Fill x21 LABEL .FILL x48 THING .STRINGZ "ar" A BLAH .FILL x21 .END Program Output: b. (4 points) The following program is supposed to print the number 5 on the screen, but does not work. Explain, in 10 words or less, why it does not work as intended. Insert the code needed to make the program work as intended. DO NOT change any of the instructions. 2. . ORIG x3000 JSR A OUT BRnzp DONE AND RO, RO, #0 ADD RO,RO, #5 - RET DONE HALT ASCII .FILL x0030 R1, ASCII RO, RO, RI LD ADD RET . END
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
