I am given a few lines of code and told to write the corresponding LC3 instructions. I am having trouble determining the offset value.
For example:
x3100 1110001000100000
So 1110 is the opcode for LEA. 001 signifies R1. The rest confuses me. I am left with 000100000. Looking at the LC-3 Instruction List, the syntax for LEA is as follows
LEA--> |1110|DR|PCoffset9|
How do I figure out what PCoffset9 is from my code? 000100000 is the number 32, so is it:
LEA R1, #32 ;is this right?
That doesn't seem right. I thought I recalled seeing these numbers represented as memory locations? So 000100000 would be x020? I am so confused on how to figure out the offset.