Empty MMX State

Encoding

EncodingOperand
zoNone

Description

The EMMS instruction empties (clears) the MMX state. It does so by setting all eight fields in FPU.TagWord to empty (11b).

This instruction must be used before using the x87 FPU (if any MMX instructions were executed). Failure to do so is undefined and could result in an FPU stack overflow that can result in either an #MF exception or an incorrect result.

Operation

public void EMMS()
{
    FPU.TagWord = 0xFFFF;
}

Flags Affected

None.

Intrinsics

Exceptions

Real-Address Mode

#UD
  • If the LOCK prefix is used.
  • If CR0.EM is set (no internal or external FPU)
#NM
  • If
  • CR0.TS
  • is set (a task switch occurred).
#MF
  • If an FPU exception is pending.

Virtual-8086 Mode

#UD
  • If the LOCK prefix is used.
  • If CR0.EM is set (no internal or external FPU)
#NM
  • If
  • CR0.TS
  • is set (a task switch occurred).
#MF
  • If an FPU exception is pending.

Protected Mode

#UD
  • If the LOCK prefix is used.
  • If CR0.EM is set (no internal or external FPU)
#NM
  • If
  • CR0.TS
  • is set (a task switch occurred).
#MF
  • If an FPU exception is pending.

Compatibility Mode

#UD
  • If the LOCK prefix is used.
  • If CR0.EM is set (no internal or external FPU)
#NM
  • If
  • CR0.TS
  • is set (a task switch occurred).
#MF
  • If an FPU exception is pending.

Long Mode

#UD
  • If the LOCK prefix is used.
  • If CR0.EM is set (no internal or external FPU)
#NM
  • If
  • CR0.TS
  • is set (a task switch occurred).
#MF
  • If an FPU exception is pending.