This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

NMI and IRQ execution time

NMI and IRQ execution time
by on (#99570)
Does anybody know the execution time of NMIs and IRQs? I've written a small test program, and from what I can see, NMI seems to take 5 cycles. Is that correct? I was expecting 7 cycles (like BRK), or maybe 6 cycles (one faster than BRK).
EDIT: No, my test program indicates 7 cycles (not 5 cycles). I've been doing something wrong when counting clock cycles.

Surprisingly, there appears to be little or no info on IRQ/NMI timings in the internet. The typical opcode charts are listing only opcode timings... And in-depth NMI related pages are only discussing rather obscure scenarios like "what happens if a NMI collides with a branch opcode?"
Re: NMI and IRQ execution time
by on (#99582)
They take 7 cycles under normal, non-obscure scenario circumstances. (Actually, so does RESET, which uses some of the same interrupt logic, save for writing to the stack.)
Re: NMI and IRQ execution time
by on (#99583)
googling for "6502 interrupt timing" found http://www.6502.org/tutorials/interrupts.html#1.3 as the first hit...