HYUNDAI MicroElectonics
6
X-Register
Y-Register
1.5. Indexed Addressing Mode
In the indexed addressing mode the contents of an index register(X,Y) is added to the address part of the
instruction to obtain the effective address. The index register contains an index value. The address field of
the instruction defines the beginning address of a data array in memory. Each operand in the array is stored
in memory relative to the beginning address. The distance between the beginning address and the address
of the operand is index value stored in the register.
X-register Indexed Addressing Mode in direct page(dp)
dp+X
The effective address is determined by adding the address of operand and the contents of X-register. it is
specified to direct page of memory.
OP CODE
dp
Operand
Instructions
A,Memory
ADC
AND
CMP
LDA
EOR
OR
SBC
STA
ASL
DEC
INC
LSR
ROL
ROR
XMA
Y,Memory
LDY
STY
Example)
( G=0, X=F5
h
)
06 45
ADC 45H+X
Y-register Indexed Addressing Mode in direct page
dp+Y
The effective address is determined by adding the address of operand and the contents of Y-register. it is
specified to direct page of memory.
OP CODE
dp
Operand
Instructions
X,Memory
LDX
STX
= 1 3A
+
Op code ( 06 )
Operand ( 45 )
data
X ( F5 )
MEMORY
A
←
A+data+C
000
h
0FF
h
100
h
03A
h
1FF
h
0 Page
1 Page