Assembly x86 – “leave” Instruction
LEAVE is the counterpart to ENTER. The ENTER instruction sets up a stack frame by first pushing EBP onto the stack and then copies ESP into EBP, so LEAVE has to do the opposite, i.e. copy EBP to ESP and then restore the old EBP from the stack. See the section named PROCEDURE CALLS FOR BLOCK-STRUCTURED LANGUAGES in Intel’s Software Developer’s Manual Vol 1 if you want to read more about how ENTER and LEAVE work. enter n,0 is exactly equivalent … Read more