When running a program, the CPU firsts loads an instruction. It then processes data using this instruction. Addressing modes tell the CPU where to find the data. The 6502 has several addressing modes. A sample is given below.
IMMEDIATE addressing
In the program, the data follows the instruction.
ADD 99
Add 99 to the contents of the accumulator.
ABSOLUTE addressing
In the program, the 16 bit address of the data follows the instruction.
STA 1243
Store the contents of the accumulator at address 1243.
ZERO PAGE addressing In the program, the instruction is followed by an 8 bit address.
This means that only addresses 0-255 (in page zero) can be used.
CMP 230
Compare the contents of the accumulator with the contents of address 0230.
Other addressing modes are IMPLIED
RELATIVE
ACCUMULATOR
INDEXED
INDIRECT |