Alright...I'm ORA-ing new values into a particular byte, but reading that byte is not having the expected results. Just seeing if this looks right to you guys or if there is something fundamentally wrong.
To set the bit, I might use a subroutine that did:
LDA theState
ORA #%01000000
STA theState
;;;; This should set bit 6, right?
And to clear the bit...
LDA theState
ORA #%00000000
STA theState
;;;; This should clear bit 6, right?
Ignoring the factors of the other bits, does this seem sound? Right now, my subroutine to clear the bit doesn't seem to be working.
Thanks!
Code:
GameLoop:
LDA theState
AND #%01000000
BEQ bitIsClear
;;;;;;do things here if the bit is set
JMP skipClearBit
bitIsClear:
JMP RESET
skipClearBit:
JMP GameLoop
LDA theState
AND #%01000000
BEQ bitIsClear
;;;;;;do things here if the bit is set
JMP skipClearBit
bitIsClear:
JMP RESET
skipClearBit:
JMP GameLoop
To set the bit, I might use a subroutine that did:
Code:
LDA theState
ORA #%01000000
STA theState
;;;; This should set bit 6, right?
And to clear the bit...
Code:
LDA theState
ORA #%00000000
STA theState
;;;; This should clear bit 6, right?
Ignoring the factors of the other bits, does this seem sound? Right now, my subroutine to clear the bit doesn't seem to be working.
Thanks!