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

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!