
HT9580
46
April 28, 2000
Preliminary
Addressing modes
The M6502 supports fifteen (15) addressing
modes, shown in table below. In interpreting
this table you should note that:
Thebytefollowinga2byteopcode=IAL(typ.)
The 2 bytes following a 3 byte opcode = BAL
and BAH (typ.)
Standard assembly notation is used
A number in parenthesis indicates that the
contents of the location pointed to by the
number are to be used. For example (12H) in-
dicates the contents of address 12H.
Acommaintheaddressisusedtoindicatethe
high and low byte of an address. For example
(01H, AAH) indicates the contents of address
01AAH.
Mode
Description
IMP
IMPLIED: The data is implied in the opcode (example: CLC)
ACC
ACCUMULATOR: The accumulator is used as the source data. (data=AREG)
IMM
IMMEDIATE: The byte following the opcode is the data. (data=IAL)
ZPG
ZERO PAGE: The first 256 RAM locations (0000H~00FFH) are used for fast access
and small code size. The upper 8-bit of the address are always zero. [data=(00, IAL)]
ZPX
ZERO PAGE INDIRECT X: The X register is added to the byte following the opcode to
give a new zero page address. Note that the upper 8-bit of the address are always zero.
[data=(00, IAL+X)]
ZPY
ZERO PAGE INDIRECT Y: The Y register is added to the byte following the opcode to
give a new zero page address. Note that the upper 8-bit of the address are always zero.
Only the LDX and the STX opcodes use this mode. [data=(00, IAL+Y)]
ABS
ABSOLUTE: The two bytes following the opcode give the absolute address of the data.
[data=(BAH, BAL)]
ABX
ABSOLUTE X: The X register is added to the two bytes following the opcode to produce
a new 16-bit address. {data=[(BAH, BAL)]+X}
ABY
ABSOLUTE Y: The Y register is added to the two bytes following the opcode to produce
a new 16-bit address. {data=[(BAH, BAL)]+Y}
ABI
ABSOLUTE INDIRECT: The two bytes following the opcode are used as a pointer to
memory. Only the JMP opcode uses this mode. [data=(BAH, BAL)]
AIX
INDEXED ABSOLUTE INDIRECT X: The two bytes following the opcode are added to
the X register to yield a new 16-bit address. The contents of this address and the fol-
lowing one are used as an indirect address. Only the JMP opcode uses this mode.
{data=[(BAH, BAL+X+1), (BAH, BAL+X)]}
IND
INDIRECT: The byte following the opcode is used as a pointer to the zero page. The
contents of this address and the following one are used as the address to finally access
the data. {data=[(IAL+1), (IAL)]}