13.07.2015 Views

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NUMERICS PROCESSOR EXTENSIONThe offending ESC instruction cannot be restarted. The task containing the ESC instruction (whichmay not be the current task) must eventually be cancelled.The exception handler must execute an FINIT instruction before executing a WAIT or other ESCinstruction; otherwise, the WAIT or ESC instruction will never finish. FlNIT does not affect the CS:IPvalue and data address saved in the 80287.Note that the 80<strong>286</strong> CPU detects some addressing violations before sending the ESC instruction tothe 80287 NPX. In these. cases, the CPU causes trap 13 (pushing an error code of zero), and it isgenerally possible to restart the ESC instruction. Refer to Chapter 7 for more information regardingtrap 13.Interrupt 16-Processor Extension Error (MF)The 80287 detects six different exception conditions during instruction execution. If the detectedexception is not masked by a bit in the control word, the 80287 communicates the fact that an erroroccurred to the CPU by a signal at the ERROR pin. The CPU causes interrupt 16 the next time itchecks the ERROR pin, which is only at the beginning of a subsequent WAIT or certain ESC instructions.If the exception is masked, the 80287 handles the exception according to on-board logic; it doesnot assert the ERROR pin in this case.The six exception conditions are1. INVALID OPERATION2. OVERFLOW3. ZERO DIVISOR4. UNDERFLOW5. DENORMALIZED OPERAND6. PRECISION (INEXACT RESULT)The steps to be taken to remove the error condition depend on the application.Once the exception handler corrects the error condition causing the exception, the floating pointinstruction that caused the exception can be restarted, if appropriate. This cannot be accomplished byIRET, however, because the trap occurs at the ESC or WAIT instruction following the offending ESCinstruction. The handler must obtain from the 80287 the address of the offending instruction in thetask that initiated it, make a copy of it, execute the copy in the context of the offending task, and thenreturn via IRET to the current CPU instruction stream.The ESC instructions that do not cause automatic checking of the ERROR pin are FNCLEX, FNINIT,FSAVE, FSETPM, FSTCW, FSTENV, and FSTSW. You can use the WAIT instruction to test theERROR pin before these instructions, if necessary.12-5 121960·001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!