Instruction
POPA
Pops the eight general-purpose registers that PUSHA saved, 16-bit or with POPAD 32-bit, discarding the saved stack pointer; not in 64-bit mode.
- Extensions
- Mnemonics
- POPA, POPAD
- Forms
- 2 (2 Legacy)
- Data
- Intel XED v2026.08.23
POPA pops the eight general-purpose registers that PUSHA pushed: DI, SI and BP, then the slot of SP, which it skips, then BX, DX, CX and AX. The stack pointer is not loaded from the stack; it simply ends 16 bytes higher, or 32 with POPAD, past the whole frame. The operand size picks the width as it does for PUSHA, and the two mnemonics are one opcode, 61. No flag changes.
Since the saved SP is ignored, a handler that wants to return a value in
a register writes it into that register’s slot of the frame before POPA:
AX’s is the highest, 14 bytes above SP for POPA and 28 for POPAD. As for
PUSHA, GNU as 2.44 and Clang 23 encode popa in 32-bit code as the
32-bit form and take popaw for the 16-bit one. A frame that starts or
ends outside the stack segment raises #SS.
Not in 64-bit mode
Opcode 61 raises #UD in 64-bit mode, so the fixture has no case for
POPA: the probe runs there and lists both forms as not run. 64-bit code
restores registers with POP or APX’s POP2,
and GNU as 2.44 and Clang 23 refuse popa there. AMD’s Zen 5 guide
lists POPA as microcoded, without a latency.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
POPA not in 64-bit mode
POPA | 66 61 | Base instruction set |
POPAD not in 64-bit mode
POPAD | 61 | Base instruction set |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
n = OSIZE // 8 # POPA: 2 bytes each; POPAD: 4
a = esp
rDI = load(a, OSIZE)
rSI = load(a + n, OSIZE)
rBP = load(a + 2 * n, OSIZE) # the slot of ESP is skipped
rBX = load(a + 4 * n, OSIZE)
rDX = load(a + 5 * n, OSIZE)
rCX = load(a + 6 * n, OSIZE)
rAX = load(a + 7 * n, OSIZE)
esp = a + 8 * nNot run on a processor: POPA does not exist in 64-bit mode, where the probe runs.
Operands
Flags
None: XED records no flag that the forms test or change.
CPUID and processors
Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.
| ISA set | CPUID | Processors |
|---|---|---|
I186 | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
I386 | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
More General-purpose instructions
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-403 (POPA/
POPAD) - AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
- Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP
The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The text is our own.