|
indirect indexing looks like this: lda (addr_lo),y
But a few assemblers use brackets instead of parenthesis.
What you'd do to use it, is put the address to your nametable data in 2 bytes of zeropage-RAM. We'll call them addr_lo and addr_hi. You'd do that (in most assemblers) like this:
lda #sta addr_lo lda #>mapdata sta addr_hi
That's the 'indirect' part. The indexing part uses the Y register, and is an index into the address that we have in addr_lo,addr_hi
A way to use it would be like this:
ldx #4 ; (load 256*4 bytes) ldy #0 loop: lda (addr_lo),y sta $2007 iny bne loop inc addr_hi dex bne loop
See how that works? Indirect indexed mode is also useable with several other instructions, it can be really useful.
|