Intel 64 and IA-32 Architectures Software Developers Manual Volume 1, Basic Architecture

Vol. 1 8-23
PROGRAMMING WITH THE X87 FPU
Store the value in an ST(0) register to memory in floating-point, integer, or
packed BCD format.
Move values between registers in the x87 FPU register stack.
The FLD (load floating point) instruction pushes a floating-point operand from
memory onto the top of the x87 FPU data-register stack. If the operand is in single-
precision or double-precision floating-point format, it is automatically converted to
double extended-precision floating-point format. This instruction can also be used to
push the value in a selected x87 FPU data register onto the top of the register stack.
The FILD (load integer) instruction converts an integer operand in memory into
double extended-precision floating-point format and pushes the value onto the top of
the register stack. The FBLD (load packed decimal) instruction performs the same
load operation for a packed BCD operand in memory.
The FST (store floating point) and FIST (store integer) instructions store the value in
register ST(0) in memory in the destination format (floating point or integer, respec-
tively). Again, the format conversion is carried out automatically.
The FSTP (store floating point and pop), FISTP (store integer and pop), and FBSTP
(store packed decimal and pop) instructions store the value in the ST(0) registers
into memory in the destination format (floating point, integer, or packed BCD), then
performs a pop operation on the register stack. A pop operation causes the ST(0)
register to be marked empty and the stack pointer (TOP) in the x87 FPU control work
to be incremented by 1. The FSTP instruction can also be used to copy the value in
the ST(0) register to another x87 FPU register [ST(i)].
The FXCH (exchange register contents) instruction exchanges the value in a selected
register in the stack [ST(i)] with the value in ST(0).
The FCMOVcc (conditional move) instructions move the value in a selected register
in the stack [ST(i)] to register ST(0) if a condition specified with a condition code (cc)
is satisfied (see Table 8-5). The condition being tested for is represented by the
Table 8-4. Data Transfer Instructions
Floating Point Integer Packed Decimal
FLD Load Floating
Point
FILD Load Integer FBLD Load Packed
Decimal
FST Store Floating
Point
FIST Store Integer
FSTP Store Floating
Point and Pop
FISTP Store Integer
and Pop
FBSTP Store Packed
Decimal and Pop
FXCH Exchange Register
Contents
FCMOVcc Conditional Move