72 lines
2.7 KiB
HTML
72 lines
2.7 KiB
HTML
<html><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
|
<html>
|
|
|
|
<head>
|
|
<title>80386 Programmer's Reference Manual -- Opcode PUSHA</title>
|
|
</head>
|
|
|
|
<body>
|
|
<b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
|
|
<b>prev:</b><a href="PUSH.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/PUSH.HTM"> PUSH Push Operand onto the Stack</a><br>
|
|
<b>next:</b><a href="PUSHF.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/PUSHF.HTM"> PUSHF/PUSHFD Push Flags Register onto the Stack</a>
|
|
<p>
|
|
<hr>
|
|
<p>
|
|
<h1>PUSHA/PUSHAD -- Push all General Registers</h1>
|
|
<pre>
|
|
|
|
|
|
|
|
Opcode Instruction Clocks Description
|
|
|
|
60 PUSHA 18 Push AX, CX, DX, BX, original SP, BP, SI, and
|
|
DI
|
|
60 PUSHAD 18 Push EAX, ECX, EDX, EBX, original ESP, EBP,
|
|
ESI, and EDI
|
|
</pre>
|
|
<h2>Operation</h2>
|
|
<pre>
|
|
|
|
|
|
|
|
IF OperandSize = 16 (* PUSHA instruction *)
|
|
THEN
|
|
Temp := (SP);
|
|
Push(AX);
|
|
Push(CX);
|
|
Push(DX);
|
|
Push(BX);
|
|
Push(Temp);
|
|
Push(BP);
|
|
Push(SI);
|
|
Push(DI);
|
|
ELSE (* OperandSize = 32, PUSHAD instruction *)
|
|
Temp := (ESP);
|
|
Push(EAX);
|
|
Push(ECX);
|
|
Push(EDX);
|
|
Push(EBX);
|
|
Push(Temp);
|
|
Push(EBP);
|
|
Push(ESI);
|
|
Push(EDI);
|
|
FI;
|
|
</pre>
|
|
<h2>Description</h2>
|
|
PUSHA and PUSHAD save the 16-bit or 32-bit general registers, respectively, on the 80386 stack. PUSHA decrements the stack pointer (SP) by 16 to hold the eight word values. PUSHAD decrements the stack pointer (ESP) by 32 to hold the eight doubleword values. Because the registers are pushed onto the stack in the order in which they were given, they appear in the 16 or 32 new stack bytes in reverse order. The last register pushed is DI or EDI.
|
|
<h2>Flags Affected</h2>
|
|
None
|
|
<h2>Protected Mode Exceptions</h2>
|
|
#SS(0) if the starting or ending stack address is outside the stack segment limit; #PF(fault-code) for a page fault
|
|
<h2>Real Address Mode Exceptions</h2>
|
|
Before executing PUSHA or PUSHAD, the 80386 shuts down if SP or ESP equals 1, 3, or 5; if SP or ESP equals 7, 9, 11, 13, or 15, exception 13 occurs
|
|
<h2>Virtual 8086 Mode Exceptions</h2>
|
|
Same exceptions as in real-address mode; #PF(fault-code) for a page fault
|
|
<p>
|
|
<hr>
|
|
<p><b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
|
|
<b>prev:</b><a href="PUSH.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/PUSH.HTM"> PUSH Push Operand onto the Stack</a><br>
|
|
<b>next:</b><a href="PUSHF.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/PUSHF.HTM"> PUSHF/PUSHFD Push Flags Register onto the Stack</a>
|
|
</body>
|
|
|