While playing megaman for nes, I noticed that whenever I "step into" when playing, the program counter takes me to 0xC02B, which code is:
07:C02B:A5 1F LDA $001F = #$00 ; load acumulator with value at $001F, which is 0x00
07:C02D:F0 FC BEQ $C02B ; if Z is set (which always is), jumps back to previous instruction
the above code was commented by me, and dissassembled thru FCEUX
My problem with this code is, the adress being loaded at A is always 0x00, so the branch will always occur, right?
But if I keep stepping into, the code will branch to $D4A8, totally out of the blue, right after loading A in the the instruction at C02B!
Why does that happen?