This is based off this question LEA instruction
Here is the code segment I have a question about
.ORIG X3700
LEA R0, A
.....
A .FILL X1234
@Paul R, the answer responder, said that "The origin of the code is x3700, and you have 12 instructions, so the address of A will be x3700 + x0C = x370C. As you guessed, LEA R0,A loads the address of A into R0, so R0 will contain x370C after that first instruction has been executed."
I agree with the first part of what Paul said, his reasoning for why the address of A is x370C. That makes sense.
I am confused about the next part, that "LEA R0, A loads the address of A into R0". This is the slide my reference has on the LEA instruction. Lc3 LEA, 5-23
Unlike the ADD and AND instructions, the LEA instruction has only one mode.(reference specifies both modes for ADD and AND.
From this diagram, the second part of LEA, A should be PCoffset 9. However the value of A is 4660(in decimal) from ,A .FILL X1234, which is beyond the PCoffset 9 range, which is -256 to 255).
Can anyone explain what is going on? Am I using the wrong diagram as a reference? Is there another LEA mode?