Skip to content
Lillith 🌸 edited this page Aug 13, 2024 · 3 revisions

Explanation

Since the 6502 is CISC (Complex Instruction Set Computer), each instruction has different ways of determining where it can get data from. Which is an address mode. Each instruction can have multiple address modes. The amount of address modes for each instruction varies, consult the 6502 instruction set documentation for more information.

The address mode of an instruction is determined by the op code ex: 0xa9 is LDA immediate but 0xa2 is LDA Zero page. the address mode can also change how much clock cycles an instruction takes

Address Modes

Implied

for instructions that manipulate the Status register and what not they normally take 1 cycle. (like CLC)

Relative

for BEQ, BNE. it adds on to the PC +/- 128

Immediate

just returns the PC.

zero page x,y

8 bit ptr with offsets of x,y

Absolute x,y

16 bit ptr with offsets x,y

indirect x,y

16 bit ptr with the LSB in it can offset with x,y

Resources

https://www.nesdev.org/obelisk-6502-guide/addressing.html#IDX