Hi everyone... wasn't sure if this should go here or in NESDev, but it's kind of a noob question so I figured I'd start here.
Let's say I have a label and a chunk of 500 bytes of data I want to loop over
So I want to start loading at data chunk and loop until I have done some sort of processing on all 500 bytes
So obviously that won't work because x can only go up to 255, so the question is, what's the best way to loop over all 500 entries?
Thanks,
Rick
Let's say I have a label and a chunk of 500 bytes of data I want to loop over
Code:
datachunk:
.byte $20,$21,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00, ... etc out to 500 bytes
.byte $20,$21,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00, ... etc out to 500 bytes
So I want to start loading at data chunk and loop until I have done some sort of processing on all 500 bytes
Code:
ldx #0
loop:
lda datachunk, x
inx
(do something with the data here)
cpx #500
bne loop
loop:
lda datachunk, x
inx
(do something with the data here)
cpx #500
bne loop
So obviously that won't work because x can only go up to 255, so the question is, what's the best way to loop over all 500 entries?
Thanks,
Rick