3-156
INSTRUCTION SET REFERENCE
EMMSEmpty MMX State
Description
This instruction sets the values of all the tags in the FPU tag word to empty (all ones). This oper-
ation marks the MMX technology registers as available, so they can subsequently be used by
floating-point instructions. Refer to Figure 7-11 in Chapter 7, Floating-Point Unit of the Intel
Architecture Software Developers Manual, Volume 1, for the format of the FPU tag word. All
other MMX instructions (other than the EMMS instruction) set all the tags in FPU tag word
to valid (all zeroes).
The EMMS instruction must be used to clear the MMX technology state at the end of all
MMX technology routines and before calling other procedures or subroutines that may
execute floating-point instructions. If a floating-point instruction loads one of the registers in the
FPU register stack before the FPU tag word has been reset by the EMMS instruction, a floating-
point stack overflow can occur that will result in a floating-point exception or incorrect result.
Operation
FPUTagWord
<
FFFF
Intel C/C++ Compiler Intrinsic Equivalent
Pre-4.0 Intel C/C++ Compiler intrinsic:
void_m_empty()
Version 4.0 and later Intel C/C++ Compiler intrinsic:
void_mm_empty()
Clears the MMX technology state.
Flags Affected
None.
Protected Mode Exceptions
#UD
If EM in CR0 is set.
#NM
If TS in CR0 is set.
#MF
If there is a pending FPU exception.
Opcode
Instruction
Description
0F 77
EMMS
Set the FP tag word to empty.