THE
80286
INSTRUCTION SET
The offending floating point instruction cannot be restarted; the task which attempted
to
execute the
offending numeric instruction must be aborted. However, if exception 9 interrupted another
ta~k,
the
interrupted task may be restarted.
The exception 9 handler
must execute
FNINIT
before executing any ESCAPE or WAIT instruction.
#NM
7
No
Math Unit Available (No Error Code)
This exception occurs when any floating point instruction
is
executed while the EM bit or the TS bit
of the Machine Status Word
is
1.
It
also occurs when a WAIT instruction
is
encountered and both the
MP and TS bits of the Machine Status Word are
1.
Depending
on
the setting of the MSW bits that caused this exception, the exception handler could
provide emulation of the
80287, or it could perform a context switch of the math processor to prepare
it
for
use by another task.
The instruction causing #NM can be restarted if the handler performs a numeric context switch.
If
the
handler provided emulation of the math unit, it should advance the return pointer beyond the floating
point instruction that caused NM.
#NP
11
Not Present (Selector Error Code)
This exception occurs when CS, DS, ES, or the Task Register
is
loaded with a descriptor that
is
marked not present but
is
otherwise valid.
It
can occur in
an
LLDT instruction, but the #NP exception
will
not occur if the processor attempts
to
load the LDT register during a task switch. A not-present
LDT encountered during a task switch causes the
#TS exception.
The error code passed
is
the selector of the descriptor that
is
marked not present.
Typically, the Not
Present exception handler
is
used
to
implement a virtual memory system. The
operating system can swap inactive memory segments to a mass-storage device such as a disk.
Appli-
cations programs need not be told about this; the next time they attempt to access the swapped-out
memory segment, the Not
Present handler
will
be
invoked, the segment
will
be brought back into
memory, and the offending instruction within the applications program
will
be restarted.
If
#NP
is
detected
on
loading CS, DS, or ES
in
a task switch, the exception occurs
in
the
new
task,
and the IRET from the exception handler jumps directly
to
the next instruction in the
new
task.
The Not
Present exception handler must contain special code
to
complete the loading of segment
!"egi~ter~
~~lhe!!
#NP
i~
tl",te>cte>ci
in
loading the CS
orDS
registers in a task switch and a trap or inter-
rupt gate
was
used.
T~e
DS and ES registers have been loaded but their descriptors have not been
loaded. Any memory reference using the segment register may cause exception
13.
The #NP exception
handler should execute code such as the following
to
ensure full loading of the segment registers:
MOV AX,DS
MOVDS,AX
MOV AX,ES
MOVES,AX
8-10