STAC

Set AC Flag in EFLAGS Register

stableVMJITAOTinstruction

Encodings

OpcodeInstructionOp/En64-bitCompat/LegacyDescription
NP 0F 01 CBSTACZOValidValidSet the AC flag in the EFLAGS register.

Measured cost

Loading measurements from arch-data...

Flags named

Description

Sets the AC flag bit in EFLAGS register. This may enable alignment checking of user-mode data accesses. This allows explicit supervisor-mode data accesses to user-mode pages even if the SMAP bit is set in the CR4 register. This instruction's operation is the same in non-64-bit modes and 64-bit mode. Attempts to execute STAC when CPL > 0 cause #UD.

Operation

EFLAGS.AC := 1;

Flags affected

AC set. Other flags are unaffected.

Exceptions

Protected mode
#UDIf the LOCK prefix is used. If the CPL > 0. If CPUID.07H.00H:EBX.SMAP[20] = 0.
Real address mode
#UDIf the LOCK prefix is used. If CPUID.07H.00H:EBX.SMAP[20] = 0.
Virtual-8086 mode
#UDThe STAC instruction is not recognized in virtual-8086 mode.
Compatibility mode
#UDIf the LOCK prefix is used. If the CPL > 0. If CPUID.07H.00H:EBX.SMAP[20] = 0.
64-bit mode
#UDIf the LOCK prefix is used. If the CPL > 0. If CPUID.07H.00H:EBX.SMAP[20] = 0.

Sources