FXAM

Examine Floating

OpcodeModeLeg ModeDescription
D9 E5Classify value or number in ST(0).

Description

Examines the contents of the ST(0) register and sets the condition code flags C0, C2, and C3 in the FPU status word to indicate the class of value or number in the register (see the table below).

ClassC3C2C0
Unsupported000
NaN001
Normal finite number010
Infinity011
Zero100
Empty101
Denormal number110

Table 3-42. FXAM Results .

The C1 flag is set to the sign of the value in ST(0), regardless of whether the register is empty or full.

This instruction’s operation is the same in non-64-bit modes and 64-bit mode.

Operation

C1 := sign bit of ST; (* 0 for positive, 1 for negative *)
CASE (class of value or number in ST(0)) OF
    Unsupported:C3, C2, C0 := 000;
    NaN:
        C3, C2, C0 := 001;
    Normal:
        C3, C2, C0 := 010;
    Infinity:
        C3, C2, C0 := 011;
    Zero:
        C3, C2, C0 := 100;
    Empty:
        C3, C2, C0 := 101;
    Denormal:
        C3, C2, C0 := 110;
ESAC;

FPU Flags Affected

C1Sign of value in ST(0).
C0, C2, C3See Table 3-42.

Floating-Point Exceptions

None.

Protected Mode Exceptions

#​NMCR0.EM[bit 2] or CR0.TS[bit 3] = 1.
#​​MFIf there is a pending x87 FPU exception.
#​​​UDIf the LOCK prefix is used.

Real-Address Mode Exceptions

Same exceptions as in protected mode.

Virtual-8086 Mode Exceptions

Same exceptions as in protected mode.

Compatibility Mode Exceptions

Same exceptions as in protected mode.

64-Bit Mode Exceptions

Same exceptions as in protected mode.

This UNOFFICIAL, mechanically-separated, non-verified reference is provided for convenience, but it may be incomplete or broken in various obvious or non-obvious ways. Refer to Intel® 64 and IA-32 Architectures Software Developer’s Manual for anything serious.