Lahf-load status flags into ah register, Lahf—load status flags into ah register – Intel 253666-024US User Manual
Page 564

3-518 Vol. 2A
LAHF—Load Status Flags into AH Register
INSTRUCTION SET REFERENCE, A-M
LAHF—Load Status Flags into AH Register
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[bit 0] = 1.
Operation
IF 64-Bit Mode
THEN
IF CPUID.80000001H:ECX.LAHF-SAHF[bit 0] = 1;
THEN AH ← RFLAGS(SF:ZF:0:AF:0:PF:1:CF);
ELSE #UD;
FI;
ELSE
AH ← EFLAGS(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.
Opcode
Instruction
64-Bit
Mode
Compat/
Leg Mode
Description
9F LAHF
Invalid*
Valid
Load:
AH
← EFLAGS(SF:ZF:0:AF:0:PF:1:CF).
NOTES:
* Valid in specific steppings. See Description section.