LC3 LEA instruction and the value stored

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.

        .ORIG X3700
3700     LEA R0, A
3701     LDI R2, C
3702     LDR R3, R0, 2 
         ...
370b     RET

370c     A .FILL X1234
         ...

Leave a Comment