Hello to everyone,
I've another noob question on ASM 6052. I can't really understand the difference between LDA VARIABLE and LDA #VARIABLE. To be more precise:
I've a variable:
EM_ENEMY_1_STATE .rs 1
and a constant:
PLAYER_STATUS_WALK = $0001
I know that if I do LDA #EM_ENEMY_1_STATE it load the ADDRESS into accumulator, if I do LDA EM_ENEMY_1_STATE it load the VALUE. And that's ok, but, I i try to load a Constant and put the value into a variable, the variable is always 0000.
lda PLAYER_STATUS_WALK
sta EM_ENEMY_1_STATE
EM_ENEMY_1_STATE == 00
lda #PLAYER_STATUS_WALK
sta EM_ENEMY_1_STATE
EM_ENEMY_1_STATE == 01
But, that's the value or the address? I can't understand why in the first case is 0 and in the second is 01.
Thanks a lot for any response!
I've another noob question on ASM 6052. I can't really understand the difference between LDA VARIABLE and LDA #VARIABLE. To be more precise:
I've a variable:
EM_ENEMY_1_STATE .rs 1
and a constant:
PLAYER_STATUS_WALK = $0001
I know that if I do LDA #EM_ENEMY_1_STATE it load the ADDRESS into accumulator, if I do LDA EM_ENEMY_1_STATE it load the VALUE. And that's ok, but, I i try to load a Constant and put the value into a variable, the variable is always 0000.
lda PLAYER_STATUS_WALK
sta EM_ENEMY_1_STATE
EM_ENEMY_1_STATE == 00
lda #PLAYER_STATUS_WALK
sta EM_ENEMY_1_STATE
EM_ENEMY_1_STATE == 01
But, that's the value or the address? I can't understand why in the first case is 0 and in the second is 01.
Thanks a lot for any response!