• Support PF! Buy your school textbooks, materials and every day products via PF Here!

Executing instructions in the LC-3

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:

Want to reply to this thread?

"Executing instructions in the LC-3" You must log in or register to reply here.

Related Threads for: Executing instructions in the LC-3

Replies
2
Views
1K
Replies
2
Views
599
Replies
1
Views
529
Replies
1
Views
1K
  • Posted
Replies
2
Views
2K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top