9.2 x87 Status Word
The x87 status word, FSW[15:0], is used by
hardware to record exceptional and other conditions that arise during
the execution of x87 instructions. It also contains a pointer to the
top of the x87 data register stack.
The status word bits, as shown in Figure 9.2, are as follows:
- Exception flags: The least significant seven bits,
FSW[6:0], are the exception flags. The six bits
FSW[5:0] correspond to the mask bits FCW[5:0] and record
exceptional conditions of the six types listed in
Subection 9.1. Bit 6, labelled SF, is set by hardware
to indicate a stack fault, which may occur during access of the instruction
operands (stack underflow) or destination register (stack overflow) prior to execution of
the instruction. There is no mask bit in FCW corresponding to SF. Whenever hardware
sets SF, it also sets IE.
- Exception summary: Bit 7 is the exception summary bit ES,
indicating an unmasked exception. In fact, this bit is redundant: ES
= 1 if and only if at least one of the exception flags FSW[5:0] is set
with the corresponding mask bit in FCW[5:0] clear. This
invariant is strictly maintained by hardware.
- Condition codes: Bits 8, 9, 10, and 14 are the condition
codes, C0, C1, C2, and C3, which are modified by x87 instructions.
The elementary arithmetic instructions only modify C1, which is cleared by default and set
in the event that an instruction returns a result that is larger in
absolute value than its precise mathematical value, i.e., the value has been
rounded away from 0 or replaced by an infinity.
- Stack top: The three bits FSW[13:11] encode a pointer to
the top of the x87 data stack.
- Busy bit: Bit 15 is included only for backward compatibility
with the 8087, in which it indicated that the floating-point
coprocessor was busy. It is architecturally defined to have the same
value as ES.
x87 Status Word