popf

Pop flags (default size)

Consumes an 8-byte stack value to restore writable flags, subject to privilege restrictions.

8086 and later

CFPFAFZFSFTFIFDFOF ●●●●●●●●●
  • ● loaded from the stack
  • IF Loaded only when the program has the privilege to change it. A program in the editor does not, so IF keeps its value.

Forms

  • popf

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.