I'm looking at some code sample from this site:
http://www.6502asm.com/
And looking at it i see they have some instructions that instead of using the memory location directly they use a label, for example, in the alive.asm:
lda ypos,x
And ypos is
ypos:
dcb $00,$02,$20,$02,$40,$02,$60,$02
dcb $80,$02,$a0,$02,$c0,$02,$e0,$02
dcb $00,$03,$20,$03,$40,$03,$60,$03
dcb $80,$03,$a0,$03,$c0,$03,$e0,$03
dcb $00,$04,$20,$04,$40,$04,$60,$04
dcb $80,$04,$a0,$04,$c0,$04,$e0,$04
dcb $00,$05,$20,$05,$40,$05,$60,$05
dcb $80,$05,$a0,$05,$c0,$05,$e0,$05
I know that labels differs depending on the assembler, but i am assuming it is going through that list, but how it specificity works
Here are details about the instruction lda ypos,x:
If ypos is located out of zero page (equal to or more than 0x0100):
ypos, then it loads the A register (accumulator) with the byte located at the computed addressypos is different from the high byte of the compute address ypos + X.ypos is located inside zero page (between 0x00 and 0xFF), then it may depend on your assembler (check the opcode): either it uses the indexed absolute addressing mode and it works as previously described, or:
ypos, wrapping within the range 0x00-0xFF, then it loads the A register (accumulator) with the byte located at the computed address.ypos go beyond the zero page. There might be a specific syntax in your assembler to force the absolute,X addressing mode.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With