Hi, I'm trying to plan out some stuff for my game but I'm away from my computer this weekend so I'm doing pseudo-code on paper for now. I've got a couple of quick questions about certain opcodes that I don't 100% understand after reading the opcode reference docs.
TXS & TSX:
Do these function the same PHA & PLA, the opcode reference makes it seem like they don't but I'm not sure. I think PHA decrements the stack pointer & copies the value of A into that memory location, vice versa for pull A. Do TXS & TSX work like that or do they just copy data to/from the current stack pointer location without changing the stack pointer?
Indexed Indirect vs Indirect Indexed:
I'm not sure I understand how Indexed Indirect works. Indirect indexed I think I understand works as follows:
Let's say myPointer is at $0000,$0001 and storing the address $6000, and Y is $01.
LDA (myPointer), y
So that is then looking at memory location $6001 and loading it into A.
Let's say myPointer is at $0000,$0001, and X is $02.
LDA (myPointer, x)
Is that looking at $0002,$0003. Then treating the values stored there as a pointer, looking at wherever they point to and loading it into A? That's what the reference reads like to me, but I'm not sure if that's what's actually going on.
TXS & TSX:
Do these function the same PHA & PLA, the opcode reference makes it seem like they don't but I'm not sure. I think PHA decrements the stack pointer & copies the value of A into that memory location, vice versa for pull A. Do TXS & TSX work like that or do they just copy data to/from the current stack pointer location without changing the stack pointer?
Indexed Indirect vs Indirect Indexed:
I'm not sure I understand how Indexed Indirect works. Indirect indexed I think I understand works as follows:
Let's say myPointer is at $0000,$0001 and storing the address $6000, and Y is $01.
LDA (myPointer), y
So that is then looking at memory location $6001 and loading it into A.
Let's say myPointer is at $0000,$0001, and X is $02.
LDA (myPointer, x)
Is that looking at $0002,$0003. Then treating the values stored there as a pointer, looking at wherever they point to and loading it into A? That's what the reference reads like to me, but I'm not sure if that's what's actually going on.