Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

Write an LC-3 program to accomplish the following: Assume Numl 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 RO with Numl, R1 with Num2 and R2 with Num3. At the end of your program, you should store RO at Mem[x3020), R1 at Mem[X3021] and R2 at Mem[x3022] //Load registers here If (RO+R1 > R2) Then { RO=R0+2 Ri=R1+3 } Else { RO=R0-1 Rl=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. Write an LC-3 program to accomplish the following: Assume Numl 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 RO with Numl, R1 with Num2 and R2 with Num3. At the end of your program, you should store RO at Mem[x3020), R1 at Mem[X3021] and R2 at Mem[x3022] //Load registers here If (RO+R1 > R2) Then { RO=R0+2 Ri=R1+3 } Else { RO=R0-1 Rl=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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Describe each of the classifications of business products.

Answered: 1 week ago