Closed sifferman closed 1 year ago
It looks like the original code pushes PC+2:
According to the links below, PC+2 is correct:
http://www.6502.org/tutorials/6502opcodes.html#BRK
BRK causes a non-maskable interrupt and increments the program counter by one. Therefore an RTI will go to the address of the BRK +2 so that BRK may be used to replace a two-byte instruction for debugging and the subsequent RTI will be correct.
http://forum.6502.org/viewtopic.php?t=1917#p15821
BRK is a two byte instruction in the sense that when the PC is pushed it is double-incremented.
I see! I misinterpreted brk
's functionality. Thanks for the help
Break used to grab the PC 1 higher than expected. However, the PC was already incremented (as denoted by the comment.)