9-Bit Constant Offset 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 operand.

Listing: Example - 9-Bit Constant Offset

ORG $1000
CST_TBL: DC.B $5, $10, $18, $20, $28, $30, $38, $40, $48

DC.B $50, $58, $60, $68, $70, $78, $80, $88, $90

DC.B $98, $A0, $A8, $B0, $B8, $C0, $C8, $D0, $D8

ORG $800

DATA_TBL: DS.B 40

main:

LD X,#CST_TBL

LD D2,(20,X)

LD Y,#DATA_TBL

ST D2,(18,Y)