Question
This Must be in only binary code. NO assembly code. Also DO not use .fill in this program you must do the offsets manually and
This Must be in only binary code. NO assembly code. Also DO not use .fill in this program you must do the offsets manually and again it must be in machine code only. Write an LC-3 program to accomplish the following:
If (A + B > C) Then { A=A+2 B=B+3 } Else { A=A-1 B=B-2 } Endif D=3
Note that the variables mentioned in the program will reside at the following memory locations:
A : x3020 B: x3021 C: x3022 D: x3023
Your program should make sue of the appropriate LOADs and STOREs.
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. Multiple HALTs or breakpoints have not correctly implemented above.
When testing your program, I will manually put values into memory locations x3020,x3021,x3022,x3023 . I will run your program to test various parts of the if....then....else.......endif statement.
What to submit: a text file that I may load into the simulator and run. You should test that your text file runs before submitting.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started