home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
ERR87_13
/
NMI
/
NMI.DOC
< prev
Wrap
Text File
|
1990-08-15
|
2KB
|
47 lines
NMI - Enable or disable the non-maskable interrupt on a PC or XT.
Written by D.J. Murdoch for the public domain. Feb 1988
Usage:
NMI ON - enables the NMI (interrupt 2)
NMI OFF - disables it
N.B. The lazy author requires that you put exactly one space before the
ON/OFF, and none after, or you'll get the usage message.
Description:
I don't have any idea where the non-maskable interrupt got its name, but
it's used for two purposes in a PC. It can be invoked by parity errors
in memory and by various kinds of errors in an 8087 coprocessor.
However, unless it is specifically turned on, it does nothing.
I wrote this program because the current release of Turbo Pascal (version
4.0) neglects to turn it on before telling the 8087 that it's okay to
generate interrupts. So, the first overflow or zero divide that you get
causes the 8087 to request an interrupt, but the 8086/8088 won't give it
one. The 8087 never completes the instruction that caused the problem,
and the machine locks up.
Interestingly enough, IBM fixed this problem on the AT. The 80287
requests a different interrupt (number 75h), which the BIOS reroutes to
the same address as the NMI. You'll just have to experiment to find out
what happens on any other brand.
One nagging question in the back of my mind is why the NMI defaults off.
The XT manual specifically warns you to turn it on before using the 8087
error checking. If anyone can tell me the reasoning here, please send me
a message at the address below.
NMI was written in A86, the shareware assembler.
Method:
To enable the NMI, the program sends 80h out port A0h. To disable it, it
sends a 0 out the same port.
Comments or questions:
Send them via Fidonet to DJ MURDOCH, at node 1:221/177.40.