LEAVE High Level Procedure Exit Flags: Not altered
LEAVE CPU: 186+
Logic MOV eSP,eBP POP eBP
LEAVE reverses the action of a previous ENTER. By copying the frame pointer to the stack pointer, LEAVE releases the stack space used by a procedure for its local variables. The old frame pointer is popped into BP or EBP, restoring the caller's stack frame. A subsequent RET nn instruction removes any arguments pushed onto the stack of the exiting procedure.
Note Some assemblers support LEAVE extensions that force the use of SP,BP (LEAVEW) or ESP,EBP (LEAVED) regardless of the segment's size attribute (80386+).