[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is NMI under Emulator?
- Subject: Re: What is NMI under Emulator?
- From: david@uow.edu.au (David Wilson)
- Date: 4 Mar 2002 17:25:22 +1100
- Newsgroups: comp.sys.apple2
- Organization: University of Wollongong
- References: <Kzxg8.47236$nz4.4471935@bin4.nnrp.aus1.giganews.com> <3C830A28.2060302@coli.uni-sb.de>
- Xref: archiver1.google.com comp.sys.apple2:17949
Linards Ticmanis <ticmanis@coli.uni-sb.de> writes:
>Bryan Parkoff wrote:
>> What is NMI under Emulator?
>> I have noticed that several emulator projects include hardware
>> manipulation such as IRQ and NMI. I know that IRQ is used to interrupt 6502
>> CPU such as keyboard and I/O controller cards. What about NMI? Please
>> advise.
Only the //c and //gs can interrupt on a keypress. The ][, ][+ & //e all
have to poll the keyboard register.
>Basically on the 6502 an NMI is almost the same as an IRQ. There are two
>differences:
>1.) An NMI cannot be prevented with a STI command, it gets through
>anyway. NMI means "Non Maskable Interrupt".
SEI = SEt Interrupt disable bit
CLI = CLear Interrupt disable bit
>2.) The vector to jump to is read from $FFFA/FFFB instead of $FFFE/FFFF.
Yes.
>An NMI can be used if you need a higher priority interrupt that can
>interrupt a running IRQ handler again.
Relatively unused on the Apple // family as the Disk ][ routines would
scribble over your disk should an NMI occur at the wrong time.
Copy Deprotect cards could use NMI to run software to save a disk image
of the current machine state.
3) IRQ is level sensitive. This means two devices can each pull /IRQ low
and if the IRQ handler only deals with one device, as soon as it executes
the RTI instruction, pulling the P reg from the stack with the I bit clear,
another IRQ will occur.
NMI is edge sensitive (otherwise as there is no disable bit it would
interrupt the NMI handler recursively). This means that you should only have
one device generating NMI requests (the IBM PC ISA bus has this "feature"
with its regular interrupt lines which explains why you need ~16 interrupts
on a PC when an Apple // can make do with only one).
--
David Wilson School of IT & CS, Uni of Wollongong, Australia