So, I just fixed a bug where my gamestate wasn't being tracked properly. The issue was this:
I have defines for things to make the code more readable:
When I do LDA, for example with STATE_RUNNING, it works fine and A = $03. But if I do a compare, like:
It seems to expand $03 into $0003 and only loads the high byte. The debugger shows that A gets the proper value of $01 but the compare is done against $00. I fixed it by doing:
My question is: is this the normal behaviour of the assember? Like, is this general to all assemblers and a part of addressing that I'm not aware of or a quirk of ASM6?
I have defines for things to make the code more readable:
Code:
STATE_START = $00
STATE_CHARSELECT = $01
STATE_LEVELSTART = $02
STATE_RUNNING = $03
STATE_STATUS = $04
STATE_CHARSELECT = $01
STATE_LEVELSTART = $02
STATE_RUNNING = $03
STATE_STATUS = $04
When I do LDA, for example with STATE_RUNNING, it works fine and A = $03. But if I do a compare, like:
Code:
CMP #STATE_CHARSELECT
It seems to expand $03 into $0003 and only loads the high byte. The debugger shows that A gets the proper value of $01 but the compare is done against $00. I fixed it by doing:
Code:
CMP #<STATE_CHARSELECT
My question is: is this the normal behaviour of the assember? Like, is this general to all assemblers and a part of addressing that I'm not aware of or a quirk of ASM6?