Intel 64 and IA-32 Architectures Software Developers Manual Volume 1, Basic Architecture
Vol. 1 8-3
PROGRAMMING WITH THE X87 FPU
The x87 FPU instructions treat the eight x87 FPU data registers as a register stack (see
Figure 8-2). All addressing of the data registers is relative to the register on the top
of the stack. The register number of the current top-of-stack register is stored in the
TOP (stack TOP) field in the x87 FPU status word. Load operations decrement TOP
by one and load a value into the new top-of-stack register, and store operations
store the value from the current TOP register in memory and then increment TOP by
one. (For the x87 FPU, a load operation is equivalent to a push and a store operation
is equivalent to a pop.) Note that load and store operations are also available that
do not push and pop the stack.
Figure 8-1. x87 FPU Execution Environment
0
79
R7
R6
R5
R4
R3
R2
R1
R0
Data Registers
Exponent Significand
78
64 63
15
Control
Register
0
Status
Register
Tag
Register
0
47
Last Instruction Pointer
Last Data (Operand) Pointer
10
Opcode
0
Sign