Am I understanding indirect indexed addressing correctly? I am using asm6 by the way.
If I have these variables at $0400 and $0500
$0400
MyBytes .byte 0, 0, 0, 0, 0, 0
$0500
Pointer .byte 0, 0
In my code, I initialize these variables like so:
Pointer = $00
Pointer+1 = $04
MyBytes = $AA
MyBytes+1 = $BB
MyBytes+2 = $CC etc
Now, if I understand indirect indexed addressing on the 6502, I should be able to do this:
LDA (Pointer), Y
If Y = 1, then the accumulator should have $BB in it. However, it turned out that $04 was added to the accumulator, which was taken from Pointer+1 (not MyBytes+1 which I expected).
Thanks
If I have these variables at $0400 and $0500
$0400
MyBytes .byte 0, 0, 0, 0, 0, 0
$0500
Pointer .byte 0, 0
In my code, I initialize these variables like so:
Pointer = $00
Pointer+1 = $04
MyBytes = $AA
MyBytes+1 = $BB
MyBytes+2 = $CC etc
Now, if I understand indirect indexed addressing on the 6502, I should be able to do this:
LDA (Pointer), Y
If Y = 1, then the accumulator should have $BB in it. However, it turned out that $04 was added to the accumulator, which was taken from Pointer+1 (not MyBytes+1 which I expected).
Thanks