9-Bit Constant Offset Indexed Indirect from X, Y, SP or PC ([IDX1])

A 9-bit signed constant (-256 to +255) is added to X, Y, SP or PC to form the effective address of the pointer to the operand.

Listing: Example - Indexed Indirect 9-Bit Constant Offset

ORG $1000
CST_TBL1: DC.W $1020, $1050, $2001

ORG $2000

CST_TBL: DC.B $10, $35, $46

ORG $3000

main:

LD X,#CST_TBL1

LD D6,[4,X]

The constant offset 4 is added to the value of register X ($1000) to form the address $1004. Then an address pointer ($2001) is read from memory at $1004. The register D6 is loaded with $35, the value stored at address $2001.