NMI and IRQ execution time

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

NMI and IRQ execution time

Post by nocash »

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?"
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Re: NMI and IRQ execution time

Post by doppelganger »

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.)
Be whatever the situation demands.
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: NMI and IRQ execution time

Post by lidnariq »

googling for "6502 interrupt timing" found http://www.6502.org/tutorials/interrupts.html#1.3 as the first hit...
Post Reply