FCLEX /FNCLEX
Usage: FCLEX / FNCLEX Modifies flags: None
The FCLEX instruction checks for and handles any pending unmasked floating-point exceptions before clearing the exception flags; the FNCLEX instruction does not.
Clear Floating-Point Exceptions
FCLEX ; 9B DB E2 [8086,FPU]
FNCLEX ; DB E2 [8086,FPU]
FCLEX clears any floating-point exceptions which may be pending. FNCLEX does the same thing but doesn't wait for previous floating-point operations (including the pending exceptions) to finish first.
The assembler issues two instructions for the FCLEX instruction (an FWAIT instruction followed by an FNCLEX instruction), and the processor executes each of these instructions separately. If an exception is generated for either of these instructions,
the saved EIP points to the instruction that caused the exception.
EXAMPLE:
fclex
fnclex