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

Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode


Subjectindexedaddressing spanning pages? new  
Posted bykik
Posted on4/19/04 04:53 AM
From IP66.229.20.192  



hi, I bet there is a standard way, or best way to do this, so how would you span pages in an indexed offset,

like $C000, x

then moving through the MSB as well as the LSB

$C100, X
$C200, x
$C300, x

ect...

maby if I just store the MSB in one address and the LSB in another, then can some how load them, hmm

any help is appreciated thanks




SubjectRe: indexedaddressing spanning pages? new  
Posted bydoppel^_^
Posted on4/19/04 04:59 AM
From IP68.108.57.199  



I believe that mode is called Absolute,X. I'm not really sure what you're trying to do, but usually if you need to span multiple pages of memory, you'd use the indirect indexed addressing mode ($xx),Y.

-
Be whatever the situation demands.


SubjectRe: indexedaddressing spanning pages? new  
Posted byDisch
Posted on4/19/04 3:15 PM
From IP66.82.9.43  



Yeah.... Indirect,Y looks like what you want to go with.

Just write your destination address to somewhere in zero page memory (like $10):

LDA #$00
STA $10
LDA #$C0
STA $11


Then you can use Indirect,Y with Y as the low byte of the address. When Y wraps to zero, just increment $11 and you'll do the next page.





Subjectso just to clarify new  
Posted bykik
Posted on4/20/04 04:19 AM
From IP66.229.20.192  



so in zero page using indirect indexed

say $00 is = $00
and $01 is = $c0

and the ldy with say #$05

so if lda $00,y is instructed
then the accumulator would actually load the value in address $C000 ? or $C005 ?

does y actually offset the LSB value, or does it overwrite the LSB

so like does

say $00 is = $10
and $01 is = $c0

and the ldy with say #$05

lda $00, y

still equate to lda $C005 or is it now $C015

thanks




SubjectRe: so just to clarify  
Posted byDisch
Posted on4/20/04 04:46 AM
From IP66.82.9.61  



> so if lda $00,y is instructed

It would actyally be LDA ($00),Y (can't forget the parenthesis, without them, you're using zero page mode).

Anyway, in that example, A would be loaded with what's at $C005. The value of Y is added to the adress at $00 (which was $C000). If Y + the LSB is greater than $FF.. the page boundary WILL be crossed as expected (at the cost of 1 more CPU cycle).

So in your bottom example... it would be reading from $C015. But again... don't forget the parenthesis.


"LDA ($00),Y" is not the same as "LDA $00,Y"




Subjectthx new  
Posted bykik
Posted on4/21/04 00:19 AM
From IP66.229.20.192  



yes, I left out the parenthesis, another mistake there, thanks for the nfos/help




Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo