CLAC: Clear Alignment Check Flag

For information about interpreting this page, see the help page.
Opcode and MnemonicEncoding16 bit Mode32 bit Mode64 bit ModeCPUID Feature FlagDescription
NP 0F 01 CA
CLAC
ZOValidValidValidSMAPClears the AC flag in the EFLAGS register.

Encoding

EncodingOperand
ZONone

Description

The CLAC instruction clears the AC (alignment check) flag in the EFLAGS register. If the SMAP bit is set in the CR4 register, this also disallows explicit supervisor-mode data access of user-mode pages.

This instruction can only be executed when CPL is 0 (ring 0). Attempts to execute this instruction is less privileged rings will cause a #UD exception to be thrown.

Operation

This pseudo-code uses C# syntax. A list of the types used is available here.
public void CLAC()
{
  AC = 0;
}

Exceptions

Protected Mode

#UD
If the LOCK prefix is used.
If CPL is greater than 0.
If CPUID.(EAX=07h,ECX=00h):EBX.SMAP[bit 20] is 0.

Real-Address Mode

#UD
If the LOCK prefix is used.
If CPUID.(EAX=07h,ECX=00h):EBX.SMAP[bit 20] is 0.

Virtual-8086 Mode

#UD
The CLAC instruction is not recognized in virtual 8086 mode.

Compatibility Mode

#UD
If the LOCK prefix is used.
If CPL is greater than 0.
If CPUID.(EAX=07h,ECX=00h):EBX.SMAP[bit 20] is 0.

Long Mode

#UD
If the LOCK prefix is used.
If CPL is greater than 0.
If CPUID.(EAX=07h,ECX=00h):EBX.SMAP[bit 20] is 0.