(Note: 6800 code follows; I could have rewritten it 6502 style but I wanted to show the setup going into the TST instruction)
Code: Select all
LDX #$0083
STX $00D8
LDA A #$01
STA A $00DE
...
INX
LDA A #$83
ADD A $00DE
STA A $00D9
CLR $00D8
CPX $00D8
TST $00CC
BNE $F6FE
then moves to do a test on the flag at $00CC (this other location only ever goes between a 0 and a 1).
So, what does all that rigamarole with X and $D8 accomplish? Does it just force some flags into a predetermined state before moving on to TST?