Skip to content
Henk-Jan Lebbink edited this page Jun 4, 2026 · 14 revisions

LAHF — Load Status Flags Into AH Register

Opcode Instruction Op/ En 64-Bit Mode1 Compat/ Leg Mode Description
9F LAHF ZO Invalid1 Valid Load: AH := EFLAGS(SF:ZF:0:AF:0:PF:1:CF).

NOTES:

  1. Valid in specific steppings; see Description section.

Instruction Operand Encoding

Op/En Operand 1 Operand 2 Operand 3 Operand 4
ZO N/A N/A N/A N/A

Description

This instruction executes as described above in compatibility mode and legacy mode. It is valid in 64-bit mode only if CPUID.80000001H:ECX.LAHF_SAHF_64[0] = 1.

Operation

IF 64-Bit ModeTHENIF CPUID.80000001H:ECX.LAHF_SAHF_64[0] = 1;THEN AHRFLAGS(SF:ZF:0:AF:0:PF:1:CF);ELSE #UD; FI;ELSEAHEFLAGS(SF:ZF:0:AF:0:PF:1:CF);FI;

Flags Affected

None. The state of the flags in the EFLAGS register is not affected.

Protected Mode Exceptions

#UD If the LOCK prefix is used.

Real-Address Mode Exceptions

Same exceptions as in protected mode.

Virtual-8086 Mode Exceptions

Same exceptions as in protected mode.

Compatibility Mode Exceptions

Same exceptions as in protected mode.

64-Bit Mode Exceptions

#UD If CPUID.80000001H:ECX.LAHF_SAHF_64[0] = 0. If the LOCK prefix is used.


Source: Intel® 64 and IA-32 Architectures Software Developer's Manual, Combined Volumes (Order Number 325462-091US, March 2026)
Generated: 7-6-2026

Clone this wiki locally