In the moment, I'm a bit confused. cc65 only creates blown code out of it and I haven't managed to figure it out myself yet.
What is the 6502 Assembly version of the following code?
I would have thought that this is the correct code:
But with this, my game freezes, even though it works fine with the C version.
What am I doing wrong?
(By the way, all of these variables are declared in the zeropage.)
What is the 6502 Assembly version of the following code?
Code:
unsigned char index;
const unsigned char *const *arrayOfArray;
const unsigned char *array;
array = arrayOfArray[index];
const unsigned char *const *arrayOfArray;
const unsigned char *array;
array = arrayOfArray[index];
I would have thought that this is the correct code:
Code:
LDA index
ASL
TAY
LDA (arrayOfArray + 0), Y
STA array + 0
LDA (arrayOfArray + 1), Y
STA array + 1
ASL
TAY
LDA (arrayOfArray + 0), Y
STA array + 0
LDA (arrayOfArray + 1), Y
STA array + 1
But with this, my game freezes, even though it works fine with the C version.
What am I doing wrong?
(By the way, all of these variables are declared in the zeropage.)