# `lahf`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/lahf

**Load ah from flags**

Category: System

Copies the low byte of rflags into ah.

8086 and later

[Intel's reference: LAHF](https://intel.github.io/SDM/instruction/LAHF.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | not changed |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

Reads: CF, PF, AF, ZF, SF

## Forms

- `lahf`

## Description

The operation of `LAHF` is:

```
 AH <-- SF:ZF:0:AF:0:PF:1:CF
```

See also [`SAHF`](https://asm-editor.specy.app/documentation/x86/instruction/sahf.md).

## Example

```x86
global _start

section .text
_start:
        mov rax, 12
        mov rbx, 5
        mov rcx, 3
        mov rsi, 9

        lahf

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall
```
