1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML 2.0//EN">
4 <TITLE>80386 Programmer's Reference Manual -- Opcode LEAVE
</TITLE>
7 <B>up:
</B> <A HREF=
"c17.htm">
8 Chapter
17 --
80386 Instruction Set
</A><BR>
9 <B>prev:
</B><A HREF=
"LEA.htm"> LEA Load Effective Address
</A><BR>
10 <B>next:
</B><A HREF=
"LGDT.htm"> LGDT/LIDT Load Global/Interrupt Descriptor Table Register
</A>
14 <H1>LEAVE -- High Level Procedure Exit
</H1>
17 Opcode Instruction Clocks Description
19 C9 LEAVE
4 Set SP to BP, then pop BP
20 C9 LEAVE
4 Set ESP to EBP, then pop EBP
29 ELSE (* StackAddrSize =
32 *)
35 ELSE (* OperandSize =
32 *)
42 LEAVE reverses the actions of the
43 <A HREF=
"ENTER.htm">ENTER
</A> instruction. By copying the
44 frame pointer to the stack pointer, LEAVE releases the stack space used
45 by a procedure for its local variables. The old frame pointer is popped
46 into BP or EBP, restoring the caller's frame. A subsequent
47 <A HREF=
"RET.htm">RET
</A>
48 instruction removes any arguments pushed onto the stack of the exiting
51 <H2>Flags Affected
</H2>
55 <H2>Protected Mode Exceptions
</H2>
57 #SS(
0) if BP does not point to a location within the limits of the current
60 <H2>Real Address Mode Exceptions
</H2>
62 Interrupt
13 if any part of the operand would lie outside of the effective
63 address space from
0 to
0FFFFH
65 <H2>Virtual
8086 Mode Exceptions
</H2>
67 Same exceptions as in Real Address Mode
73 <B>up:
</B> <A HREF=
"c17.htm">
74 Chapter
17 --
80386 Instruction Set
</A><BR>
75 <B>prev:
</B><A HREF=
"LEA.htm"> LEA Load Effective Address
</A><BR>
76 <B>next:
</B><A HREF=
"LGDT.htm"> LGDT/LIDT Load Global/Interrupt Descriptor Table Register
</A>