Changes

Jump to: navigation, search

6502 Addressing Modes

185 bytes added, 17:22, 14 September 2021
X, Indirect
== X, Indirect ==
An 8-bit zero-page address and the X register are added, without carry (if the addition overflows, the address wraps around within page 0). The resulting address is used as a pointer to the data being accessed. Note that, effectively, this makes the X register an index into a list of pointers. Also note that pointers are two bytes long, so the X register should be an even number when accessing a list of pointers (otherwise you'll get half of one pointer and half of another).
LDA ($05,x) ; if x=4, then the pointer at $09 (and $0a) will be used, and the accumulator loaded from the address indicated by the pointer

Navigation menu