# `popfd`

[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/popfd

**Pop eflags**

Category: Stack

Restores writable flags from a 32-bit stack value; unavailable in 64-bit mode.

386 and later · Not available in 64-bit mode

## Flags

| Flag | Effect |
| --- | --- |
| CF | loaded from the stack |
| PF | loaded from the stack |
| AF | loaded from the stack |
| ZF | loaded from the stack |
| SF | loaded from the stack |
| TF | loaded from the stack |
| IF | loaded from the stack. Loaded only when the program has the privilege to change it. A program in the editor does not, so IF keeps its value. |
| DF | loaded from the stack |
| OF | loaded from the stack |

## Forms

- `popfd`

## Description

In 64-bit mode, `popf` / `popfq` consume 8 bytes using `rsp`; `popfw` consumes 2 and supplies the low 16 bits. `popfd` is unavailable in this mode.

Privilege and architectural rules limit which flags can change. In particular, ordinary user code cannot use this instruction to freely change IOPL or IF, and some flags retain their old values. Do not treat the operation as an unrestricted assignment to `rflags`.
