NUMERIC PROGRAMMING EXAMPLES
ASSUME
INITIALIZED
REENTRANT
PROC
SAVE
CPU
REGISTERS,
ALLOCATE
STACK
SPACE
FOR
80287
STATE
IMAGE
PUSH
BP
MOV
BP,SP
SUB
SP,94
SAVE
STATE,
LOAD
NEW
CONTROL
WORD,
FOR
COMPLETION,
ENABLE
CPU
INTERRUPTS
FNSAVE
[BP-941
FLDCW
LOCAL_CONTROL
S T I
APPLICATION
EXCEPTION
HANDLING
CODE
GOES
HERE.
AN
UNMASKED
EXCEPTION
GENERATED
HERE
WILL
CAUSE
THE
EXCEPTION
HANDLER
TO
BE
REENTERED.
IF
LOCAL
STORAGE
IS
NEEDED,
IT
MUST
BE
ALLOCATED
ON
THE
CPU
STACK.
CLEAR
EXCEPTION
FLAGS
IN
STATUS
WORD
RESTORE
MODIFIED
STATE
IMAGE
MOV
BVTE
PTR
[BP-921,
OH
FRSTOR
[BP-941
DE-ALLOCATE
STACK
SPACE,
RESTORE
CPU
REGISTERS
MOV
SP,BP
POP
BP
RETURN
~O
POINT
OF
INTERRUPTIOH
IRET
REENTRANT
ENDP
Figure 4-5. Reentrant Exception Handler
4-6