Question: Write an LC-3 program to accomplish the following: Assume Num1 is located at location x3020, Num2 is located at location x3021 and Num3 is located

Write an LC-3 program to accomplish the following: Assume Num1 is located at location x3020, Num2 is located at location x3021 and Num3 is located at x3022. At the beginnning of your program, you should load R0 with Num1, R1 with Num2 and R2 with Num3. At the end of your program, you should store R0 at Mem[x3020], R1 at Mem[x3021] and R2 at Mem[x3022] //Load registers here If (R0 + R1 > R2) Then { R0=R0+2 R1=R1+3 } Else { R0=R0-1 R1=R1-2 } Endif R2=3 //Save registers here Your program should begin at location x3000. I will test your program several times. I want to see if your program successfully executes the if part, and then I will test the else part. Your program should contain only 1 HALT instruction which should also correspond to the breakpoint in the program (HALT occurs after registers are saved to memory). Multiple HALTs or breakpoints have not correctly implemented above. Please load your program into the simulator , and take a screen shot. Submit a jpeg screen shot of the simulator AND a text file of the hex code. Make sure the first line of the text file is 3000 (no X in front of numbers)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!