NMI handler interruptable by another NMI?

Let's talk about anything related to the 6502 microprocessor.
Post Reply
raccoon
Posts: 21
Joined: 05 Feb 2006
Location: The Netherlands

NMI handler interruptable by another NMI?

Post by raccoon »

Unlike IRQ, the NMI doesn't feature a corresponding flag in the status register. I'm trying to figure out the implications.
To me, it seems the 6502 cannot "remember" it is currently running an NMI handler. So the CPU remains susceptible to subsequent NMIs, allowing an indefinite number of NMI levels to nest (assuming there is plenty of time and the stack isn't full).
Does anyone know if my assumption is right, or is there some hidden flag?
I trust my somewhat flawed English is comprehensible to all.
Thowllly
Posts: 51
Joined: 22 Oct 2003
Location: Norway

Post by Thowllly »

AFAIK, your assumption is right, the 6502 doesn't know that it's handling an NMI so your NMI handler can be interupted by another NMI. But the NMI is edge trigged, not level triggered, so as long as the original NMI source doesn't release the NMI line no new NMIs will be triggered (I dont know the right terminology, I hope you understand what I mean)
raccoon
Posts: 21
Joined: 05 Feb 2006
Location: The Netherlands

Post by raccoon »

Thowllly wrote:
But the NMI is edge trigged
Yes. But come to think of it:
I guess the NMI needs to be edge triggered to prevent unstopable nesting at the blink of an eye.
I trust my somewhat flawed English is comprehensible to all.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Post by GARTHWILSON »

These things are addressed in the interrupts primer.  The NMI portion starts here.  Be sure to let it completely load before scrolling, so it will land on the right part of the page.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Post Reply