Incomputing, anon-maskable interrupt (NMI) is a hardwareinterrupt that standardinterrupt-masking techniques in the system cannot ignore. It typically occurs to signal attention for non-recoverable hardwareerrors. Some NMIs may be masked, but only by using proprietary methods specific to the particular NMI. With regard toSPARC, the non-maskable interrupt (NMI), despite having the highest priority among interrupts, can be prevented from occurring through the use of an interrupt mask.[1]
An NMI is often used when response time is critical or when an interrupt should never be disabled during normal system operation. Such uses include reporting non-recoverable hardware errors, system debugging and profiling, and handling of special cases like system resets.
Moderncomputer architectures typically use NMIs to handle non-recoverable errors which need immediate attention. Therefore, such interrupts should not be masked in the normal operation of the system. These errors include non-recoverable internal systemchipset errors, corruption in system memory such asparity andECC errors, and data corruption detected on system and peripheral buses.
On some systems, a computer user can trigger an NMI through hardware and softwaredebugging interfaces and system reset buttons.
Programmers typically use debugging NMIs to diagnose and correct faulty code. In such cases, an NMI can execute aninterrupt handler that transfers control to a special monitor program. From this program, a developer can inspect the machine's memory and examine the internal state of the program at the instant of its interruption. This also allows the debugging or diagnosing of computers which appearhung.
In older architectures, NMIs were used for interrupts which were typically never disabled because of the required response time. They were hidden signals. Examples include thefloppy disk controller on theAmstrad PCW, the8087coprocessor on thex86 when used in the IBM PC or its compatibles (even though Intel recommended connecting it to a normal interrupt[2]), and the Low Battery signal on theHP 95LX.
In the originalIBM PC, an NMI was triggered if a parity error was detected in system memory, or reported by an external device. In either case, the PC would display an error message and halt. Some laterIBM-compatibles used an NMI to conceal the hardware differences from that of the original IBM PC. On such computers, an NMI would be generated when a program attempted to access incompatible hardware. ABIOSinterrupt handler would then translate the program's request to match the hardware that was actually present. TheSMM in the386SL is a better way to do this.
Some 8-bithome computers used the NMI line to permit a "warm start" if the system had locked up. Typically, this would restore the control registers to known good values stored inROM, without destroying whatever data that the user might currently have loaded. On theCommodore 8-bit machines, theRESTORE key was hooked up directly or indirectly to the NMI line on the6502-series CPU, but the reset would take place only if the NMI handler routine in ROM detected thatRUN/STOP was also being held down whenRESTORE was struck (this combination being theCommodore version of athree finger salute).Commodore also connected theMOS Technology6526 CIA #2 in theC64 andC128 to the processor's NMI line, which was part of the means by which software emulation of the6551 ACIA was accomplished.Atari's 8-bit line used aSYSTEM RESET button for this same purpose.
Debugging NMIs have appeared in a number of forms, including theApple Macintosh's"programmers' button", and certain key combinations onSun workstations. With the introduction ofWindows 2000,Microsoft allowed the use of an NMI to cause a system to either break into adebugger, or dump the contents of memory to disk and reboot.[3]
Debugging NMIs have also been used by devices that allow leisure users and gamers to manipulate running programs. Devices which added a button to generate an NMI, such as Romantic Robot'sMultiface, were a popular accessory for 1980s 8-bit and 16-bit home computers. These peripherals had a small amount ofROM and an NMI button. Pressing the button transferred control to the software in the peripheral's ROM, allowing the suspended program to be saved to disk (very useful for tape-based games with no disk support, but also for saving games in progress), screenshots to be saved or printed, or values in memory to be manipulated—a cheating technique to acquire extra lives, for example.
Not all computers provide a mechanism for triggering NMIs; however, many machines (typicallyrackmount servers) provide a physical button specifically for this purpose. Other machines may expose this functionality via an expansion card.[4]
Miles Gordon Technology'sDISCiPLE and+D products for theZX Spectrum featured an NMI-producing "magic button".
On theNintendo Entertainment System, an NMI is generated during eachvertical blanking interval. Because these NMIs (often referred to as "vblank interrupts") occur at frequent, regular intervals, code that manipulates game graphics and audio is often executed inside of the NMI handler routine. Clearing the 7th bit of the PPU's$2000register disables vblank interrupts, and setting it enables them. This lets the CPU finish up mandatory tasks, at the cost oflag.