
322
Chapter 6: x87 Floating-Point Programming
AMD 64-Bit Technology
24593—Rev. 3.09—September 2003
The FSUB instruction syntax has forms that include one or two
explicit source operands. In the one-operand form, the
instruction reads a 32-bit or 64-bit floating-point value from
memory, converts it to the double-extended-precision format,
subtracts it from ST(0), and writes the result to ST(0). In the
two-operand form, both source operands are located in stack
registers. The instruction subtracts the second operand from
the first operand and writes the result to the first operand.
The FSUBP instruction syntax has forms that include zero or
two explicit source operands. In the zero-operand form, the
instruction subtracts ST(0) from ST(1), writes the result to
ST(1), and pops the stack. In the two-operand form, both source
operands are located in stack registers. The instruction
subtracts the second operand from the first operand, writes the
result to the first operand, and pops the stack.
The FISUB instruction reads a 16-bit or 32-bit integer value
from memory, converts it to the double-extended-precision
format, subtracts it from ST(0), and writes the result to ST(0).
The FSUBR and FSUBRP instructions perform the same
operations as FSUB and FSUBP, respectively, except that the
source operands are reversed. Instead of subtracting the second
operand from the first operand, FSUBR and FSUBRP subtract
the first operand from the second operand.
Multiplication.
FMUL—Floating-Point Multiply
FMULP—Floating-Point Multiply and Pop
FIMUL—Floating-Point Integer Multiply
The FMUL instruction syntax has forms that include one or two
explicit source operands that may be single-precision or double-
precision floating-point values or 16-bit or 32-bit integer values.
In the one-operand form, the instruction reads a value from
memory, multiplies ST(0) by the memory operand, and writes
the result to ST(0). In the two-operand form, both source
operands are located in stack registers. The instruction
multiplies the first operand by the second operand and writes
the result to the first operand.
The FMULP instruction syntax has forms that include zero or
two explicit source operands. In the zero-operand form, the
instruction multiplies ST(1) by ST(0), writes the result to ST(1),