NUMERIC
PROGRAMMING
EXAMPLES
CLEAR
EXCEPTION
FLAGS
IN
STATUS
WORD
RESTORE
MODIFIED
STATE
IMAGE
MOV
FRSTOR
DE-ALLOCATE
MOV
BYTE
PTR
IBP-921,
OH
IBP-941
STACK
SPACE,
RtSTORE
SP,BP
POP
B P
/
RETURN
TO
INTERRUPTED
CALCULATION
IRET
SAVE_ALL
ENDP
CPU
REGISTERS
Figure 4-3. Full-State Exception Handler (Cont'd.)
SAVE_ENVIRONMENT
PROC
SAVE
CPU
REGISTERS,
ALLOCATE
STACK
SPACE
FOR
80287
ENVIRONMENT
PUSH
BP
MOV
BP,SP
SUB
SP,14
SAVE
ENVIRONMENT,
WAIT
FOR
COMPLETION,
ENABLE
CPU
INTERRUPTS
FNSTENV
IBP-141
FWAIT
S T I
APPLICATION
EXCEPTION-HANDLING
CODE
GOES
HERE
CLEAR
EXCEPTION
FLAGS
IN
STATUS
WORD
RESTORE
MODIFIED
ENVIRONMENT
IMAGE
MOV
BYTE
PTR
IBP-121,
OH
FLDENV
IBP-141
DE-ALLOCATE
STACK
SPACE,
RESTORE
CPU
REGISTERS
MOV
SP,BP
POP
BP
RETURN
TO
INTERRUPTED
CALCULATION
IRE
T
SAVE_ENVIRONMENT
ENDP
Figure 4-4. Reduced-Latency Exception Handler
4-5