8 indexed, 16-bit offset, Indexed, 16-bit offset, Assembler syntax – Motorola HC12 User Manual
Page 136

User’s Manual
MCUez HC12 Assembler
136
Assembler Syntax
MOTOROLA
Assembler Syntax
7.4.3.8 Indexed, 16-Bit Offset
This addressing mode adds a 16-bit offset to the base index register to form the
memory address, which is referenced in the instruction. The 16-bit offset may
be considered signed or unsigned ($FFFF may be considered to be –1 or
65,535). The base index register may be X, Y, SP, PC, or PCR.
For information about indexed PC and indexed PC relative addressing modes,
see
7.4.3.16 Indexed PC versus Indexed PC Relative Addressing Mode
Example:
main:
LDX #$600
LDAA $300,X
LDY #$1000
STAA $140, Y
Accumulator A is loaded with the byte value stored in memory location $900
($600 + $300).
Then the value of accumulator A is stored at address $1140 ($1000 + $140).