* remove "\r" nonsense
[mascara-docs.git] / i386 / i386.reference / POPA.htm
blob90e11a7e8c7924073a8f2c0f8e449690608abfa3
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>80386 Programmer's Reference Manual -- Opcode POPA</TITLE>
5 </HEAD>
6 <BODY>
7 <B>up:</B> <A HREF="c17.htm">
8 Chapter 17 -- 80386 Instruction Set</A><BR>
9 <B>prev:</B><A HREF="POP.htm"> POP Pop a Word from the Stack</A><BR>
10 <B>next:</B><A HREF="POPF.htm">
11 POPF/POPFD Pop Stack into FLAGS or EFLAGS Register</A>
12 <P>
13 <HR>
14 <P>
15 <H1>POPA/POPAD -- Pop all General Registers</H1>
17 <PRE>
18 Opcode Instruction Clocks Description
20 61 POPA 24 Pop DI, SI, BP, SP, BX, DX, CX, and AX
21 61 POPAD 24 Pop EDI, ESI, EBP, ESP, EDX, ECX, and EAX
22 </PRE>
25 <H2>Operation</H2>
27 <PRE>
28 IF OperandSize = 16 (* instruction = POPA *)
29 THEN
30 DI := Pop();
31 SI := Pop();
32 BP := Pop();
33 throwaway := Pop (); (* Skip SP *)
34 BX := Pop();
35 DX := Pop();
36 CX := Pop();
37 AX := Pop();
38 ELSE (* OperandSize = 32, instruction = POPAD *)
39 EDI := Pop();
40 ESI := Pop();
41 EBP := Pop();
42 throwaway := Pop (); (* Skip ESP *)
43 EBX := Pop();
44 EDX := Pop();
45 ECX := Pop();
46 EAX := Pop();
47 FI;
48 </PRE>
50 <H2>Description</H2>
52 POPA pops the eight 16-bit general registers. However, the SP value is
53 discarded instead of loaded into SP. POPA reverses a previous
54 <A HREF="PUSHA.htm">PUSHA</A>,
55 restoring the general registers to their values before
56 <A HREF="PUSHA.htm">PUSHA</A> was
57 executed. The first register popped is DI.
58 <P>
59 POPAD pops the eight 32-bit general registers. The ESP value is
60 discarded instead of loaded into ESP. POPAD reverses the previous
61 <A HREF="PUSHA.htm">PUSHAD</A>,
62 restoring the general registers to their values before
63 <A HREF="PUSHA.htm">PUSHAD</A>
64 was executed. The first register popped is EDI.
66 <H2>Flags Affected</H2>
68 None
70 <H2>Protected Mode Exceptions</H2>
72 #SS(0) if the starting or ending stack address is not within the stack
73 segment; #PF(fault-code) for a page fault
75 <H2>Real Address Mode Exceptions</H2>
77 Interrupt 13 if any part of the operand would lie outside of the effective
78 address space from 0 to 0FFFFH
80 <H2>Virtual 8086 Mode Exceptions</H2>
82 Same exceptions as in real-address mode; #PF(fault-code) for a page
83 fault
86 <P>
87 <HR>
88 <P>
89 <B>up:</B> <A HREF="c17.htm">
90 Chapter 17 -- 80386 Instruction Set</A><BR>
91 <B>prev:</B><A HREF="POP.htm"> POP Pop a Word from the Stack</A><BR>
92 <B>next:</B><A HREF="POPF.htm">
93 POPF/POPFD Pop Stack into FLAGS or EFLAGS Register</A>
94 </BODY>