PROGRAMMING NUMERIC APPLICATIONS
FRSTOR
source
FRSTOR (restore state) reloads the 80287 from the 94-byte memory area defined by the source operand.
This information should have been written by a previous
FSA
VEjFNSA
VE instruction and not altered
by any other instruction. An FW AIT
is
not required after FRSTOR. FRSTOR
will
automatically wait
and check for interrupts until all data transfers are completed before continuing to the next instruction.
Note that the
80287 "reacts" to its
new
state at the conclusion of the FRSTOR; it will, for example,
generate an exception request if the exception and mask bits
in
the memory image
so
indicate when
the next WAIT or error-checking-ESC instruction
is
executed.
FSTENV
IFNSTENV
destination
FSTENV
jFNSTENV
(store environment) writes the 80287's basic
status-control,
status, and tag
words, and exception
pointers-to
the memory location defined by the destination operand. Typically,
the environment
is
saved
on
the CPU stack. FSTENV
jFNSTENV
is
often used by exception handlers
because it provides access
to
the exception pointers that identify the offending instruction and operand.
After saving the environment,
FSTENV
/FNSTENV
sets all exception masks
in
the processor. FSTENV
checks for pending errors before executing, FNSTENV does not.
Figure
2-2
shows the format of the environment data in memory. FNSTENV does
not
store the
environment until all
NPX
activity has completed. Thus, the data saved by the instruction reflects the
80287 after any previously decoded instruction has been executed. After writing the environment image
to memory, FNSTENV
jFSTENV
initializes the 80287 state as if
FNINIT
jFINIT
had been executed.
15
CONTROL WORD
STATUS WORD
TAG
WORD
INSTRUCTION POINTER (15-0)
INSTRUCTION
1)1
I
INSTRUCTION
POINTER
(19-16) 0
OPCODE (10-0)
DATA
POINTER (15-0)
DATA
POINTER I
(19-16)
0
15
1211
REAL
MODE
MEMORY
OFFSET
+0
+2
+4
+6
+6
+10
+12
15
CONTROL WORD
STATUS WORD
TAG
WORD
IPOFFSET
CSSELECTOR
DATA
OPERAND OFFSET
DATA
OPERAND SELECTOR
PROTECTED MODE
Figure 2-2. FSTENV
IFLDENV
Memory Layout
2-19
MEMORY OFFSET
+0
+2
+4
+6
+8
+10
+12
G30108