Figure C.1 Layout of the stack and of a stack frame.ENTERis a highly complex instruction that performs the work of quite a few
instructions. Internally, it is implemented using a fairly lengthy piece of
microcode, which creates some performance problems. For this reason most
compilers seem to avoid using ENTER, even if they support nested code blocksStack Layout
Lowest MemoryAddressHighest MemoryAddressCurrentValue ofESP CurrentValue ofEBPPreviousFunction(Caller)Stack Frame Layout
Highest Memory
AddressLocal Variable 1Local Variable 2 Return AddressParameter 1Old EBP
Local Variable 3 Parameter 2Parameter 3Local Variable 1Local Variable 2Pushed by CALL Instruction,Pushed by function prolopopped by RET instruction.Pushed by caller,popped by RETinstruction (instdcall functions) orby caller (in cdeclfunctions).gue,popped by function epilogue.Lowest MemoryAddressUnused SpaceCurrently RunningFunction’s Stack FrameBeginning of StackCaller’s Stack FrameCaller’s Stack FrameCaller’s Stack FrameDeciphering Program Data 53923_574817 appc.qxd 3/16/05 8:45 PM Page 539