6502 Perfect Timing

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
6502 Perfect Timing
by on (#5060)
Just a quick word about the 6502' interrupts. If an interrupt happens during an opcode (lets say cycle 3 of 6 ASL ZPX) is the opcode finished before the interrupt is executed? Also apparently the BRK opcode's breakpoint is ignored if the occurs, doe anyone have any more information regarding this?

by on (#5061)
Interrupts are not handled until after an instruction has finished executing. NMI/IRQ during BRK is a special case because the 6502 handles interrupts by literally executing a BRK instruction with special flags active to specify which vector to load (and to push the 'B' flag in the proper state).

by on (#5062)
Thanks for letting me know that. Just to clarify about the BRK bug. If an interrupt occurs during the BRK opcode then the opcode is not finished at all?

by on (#5064)
If an interrupt happens during a BRK, then the end of the BRK will be replaced with the end of the interrupt.