|
Post by shmiggy on Sept 18, 2024 21:40:32 GMT
"a" is a memory location or does it stand for the accumulator?
I'm only learning assembly, but I was under the impression you couldn't name a variable/label after a register.
Otherwise, to me, it's like saying the same thing twice, with different words but the same meaning, since moving the contents of the accumulator is already in ASL's description.
Just curious here.
|
|
|
Post by elmer on Sept 19, 2024 0:25:01 GMT
"a" is a memory location or does it stand for the accumulator? The 'a' in that instruction is for the accumulator. You don't need to put register names in upper case, 'a', 'x', 'y' and 'A', 'X', 'Y' are all reserved in the assembler, and all refer to the three different register names. *Some* 6502 assemblers allow you to just write ... asl ... with no parameter when you mean to refer to the accumulator, but that's not PCEAS's traditional behavior. Recent versions of PCEAS actually will allow you to write just "asl", but that's a fairly-new capability designed for compatibility with some other assemblers. Older versions of PCEAS will throw an error if you don't include the 'a'. Anyway, this ... ldy _vramSlot ;load Y "_vramSlot" is loaded as y ldx _atlas, y ;load X "atlas[vramSlot]" is loaded as x txa asl a tax
jmp [_process_vram, x]
... would be a tiny bit better if written ... ldx _vramSlot ;load Y "_vramSlot" is loaded as y lda _atlas, x ;load X "atlas[vramSlot]" is loaded as x asl a tax
jmp [_process_vram, x]
|
|