Question
Write one LC-3 program that will load two data values stored in memory locations labelled first and second. Then it will calculate the following values
Write one LC-3 program that will load two data values stored in memory locations labelled first and second. Then it will calculate the following values using bitwise logical operations and store them in the registers indicated.
a.Load first into R1.
b.Load second into R2.
c.Compute first AND second and place the result in R3.
d.Compute first OR second and place the result in R4.
e.Compute first XOR second and place the result in R5.
where A XOR B = (A OR B) AND (NOT (A AND B)).
Note that you can calculate all of these with only the LD, AND, and NOT instructions.
Choose values for first and second that demonstrate the functionality of your program (e.g. not zero!). It should work with any two 16-bit values.
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