About Indexed Indirect Addressing

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
About Indexed Indirect Addressing
by on (#64846)
I call it "Indirect X" (LDA ($80,X)) 8) .... How does it worked??? seems my understanding of that addressing mode is not correct.... Hope you guys can tell me how, much like this one:

http://nesdev.com/bbs/viewtopic.php?t=6155&highlight=indexed+indirect


thanks :D

by on (#64848)
(d,x) addressing in a nutshell:
  1. Read one byte from address ($80 + X) & $FF; put it into temporary register L.
  2. Read one byte from address ($80 + X + 1) & $FF; put it into temporary register H.
  3. The effective address is H * $100 + L. Write data here if the instruction is STA; otherwise read it and use it as the operand value for the instruction.

It's one of the less common addressing modes used in 6502 programs because it implies a pointer table on zero page. (The "& $FF" means the additions in steps 1 and 2 wrap within zero page.) Such pointer tables might be useful in, say, music engines.

by on (#64849)
thanks tepples :)