- 16

- 0

**1. Homework Statement**

Hex to LC-3

Consider the following LC-3 Program written in Hexadecimal. Convert each instruction from Hexadecimal to Binary, and choose the proper answers from each drop down selection for each instruction (I successfully converted between these, getting the binary form and Opcode listed below).

Program Listing

Address [Instruction (Hex)] [Instruction (Binary)] [Opcode]

0x3000 0x56E0 0101011011100000 AND

0x3001 0x5260 0101001001100000 AND

0x3002 0x1265 0001001001100101 ADD

0x3003 0x14C1 0001010011000001 ADD

0x3004 0x1201 0001001000000001 ADD

0x3005 0x1276 0001001001110110 ADD

0x3006 0x94BF 1001010010111111 NOT

0x3007 0x14A1 0001010010100001 ADD

If we start excecution at location x3000 and end after the instruction at x3007 completes, what are the final values in the following registers (in decimal). You can assume all values in the registers are initially zero

Don't forget to put the sign!

R1= -5 (don't know why this is right)

R2= ? (need to find answer)

R3= ? (need to find answer)

**2. Homework Equations**

The LC-3 Instruction Set can be found at:

http://www.soe.ucsc.edu/classes/cmpe012/Fall07/labs/lab7_bak/Lab 7_files/image001.png

**3. The Attempt at a Solution**

I got the binary and opcode. I have no idea why R1 is -5 and that happened to be right.

I know this might be a little difficult but I honestly no idea and was wondering if someone could help me here.

Thank You

Last edited: