NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Problem with background drawing  
Posted byMemblers
Posted on6/21/03 09:54 AM
From IP68.58.99.218  



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.




-
Entire Thread
Subject  Posted byPosted On
*Problem with background drawing  beneficii6/21/03 01:17 AM
.*Re: Problem with background drawing  Memblers6/21/03 03:58 AM
..*Re: Problem with background drawing  beneficii6/21/03 07:30 AM
....Re: Problem with background drawing  Memblers6/21/03 09:54 AM
....*Re: Problem with background drawing  Memblers6/21/03 09:57 AM
.....*Re: Problem with background drawing  beneficii6/21/03 6:26 PM
......*Re: Problem with background drawing  Memblers6/21/03 9:47 PM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo