I've seen code with many Branch opcodes with without a Compare Opcode preceding it.
I've done a little nesasm testing but i can't seem to pindown the logic behind 'delayed' branch commands.
I would expect the comparison flag is saved so it would skip, but it isnt' (Draw_Sprite is called.)
The sprite is skipped here, but i don't know why:
And this also doesn't draw... ? I'm wondering if the comparison flag is cleared somewhere..?
I've done a little nesasm testing but i can't seem to pindown the logic behind 'delayed' branch commands.
Code:
LDA #$88
CMP #$88
;sprite is drawn
LDA #$78
BEQ Skip
JSR Draw_Sprite
Skip:
CMP #$88
;sprite is drawn
LDA #$78
BEQ Skip
JSR Draw_Sprite
Skip:
I would expect the comparison flag is saved so it would skip, but it isnt' (Draw_Sprite is called.)
The sprite is skipped here, but i don't know why:
Code:
LDA #$88
CMP #$88
;sprite not drawn
LDA #$78
BNE Skip
JSR Draw_Sprite
Skip:
CMP #$88
;sprite not drawn
LDA #$78
BNE Skip
JSR Draw_Sprite
Skip:
And this also doesn't draw... ? I'm wondering if the comparison flag is cleared somewhere..?
Code:
LDA #$88
CMP #$88
;sprite not drawn
LDA #$88
BNE Skip
JSR Draw_Sprite
Skip:
CMP #$88
;sprite not drawn
LDA #$88
BNE Skip
JSR Draw_Sprite
Skip: