User Guide

x87 Floating-Point Programming 249
24592—Rev. 3.15—November 2009 AMD64 Technology
For details on how the x87 environment is stored in memory, see “Media and x87 Processor State” in
Volume 2.
6.2.7 Floating-Point Emulation (CR0.EM)
The operating system can set the floating-point software-emulation (EM) bit in control register 0
(CR0) to 1 to allow software emulation of x87 instructions. If the operating system has set
CR0.EM = 1, the processor does not execute x87 instructions. Instead, a device-not-available
exception (#NM) occurs whenever an attempt is made to execute such an instruction, except that
setting CR0.EM to 1 does not cause an #NM exception when the WAIT or FWAIT instruction is
executed. For details, see “System-Control Registers” in Volume 2.
6.3 Operands
6.3.1 Operand Addressing
Operands for x87 instructions are referenced by the opcodes. Operands can be located either in x87
registers or memory. Immediate operands are not used in x87 floating-point instructions, and I/O ports
cannot be directly addressed by x87 floating-point instructions.
Memory Operands. Most x87 floating-point instructions can take source operands from memory,
and a few of the instructions can write results to memory. The following sections describe the methods
and conditions for addressing memory operands:
“Memory Addressing” on page 14 describes the general methods and conditions for addressing
memory operands.
FNSTCW
Floating-Point No-Wait Store Control
Word
x87 Control Word
FSTCW Floating-Point Store Control Word x87 Control Word
FNSTSW
Floating-Point No-Wait Store Status
Word
x87 Status Word
FSTSW Floating-Point Store Status Word x87 Status Word
FLDENV Floating-Point Load x87 Environment
Environment, Not
Including x87 Data
Registers
FNSTENV
Floating-Point No-Wait Store
Environment
Environment, Not
Including x87 Data
Registers
FSTENV Floating-Point Store Environment
Environment, Not
Including x87 Data
Registers
Table 6-4. Instructions that Access the x87 Environment (continued)
Instruction Description State Accessed