base pointer, so room reserved in the prologue for local variables is freed. Pops the base pointer off the stack, so it is restored to its value before the prologue. Returns to the calling function, by popping the previous frame's program counter off the stack and jumping to it. The given epilogue will reverse the effects of either of the above prologues (either the full one, or the one which uses enter). Under certain calling conventions it is the callee's responsibility to clean the arguments off the stack, so the epilogue can also include the step of moving the stack pointer down or up. For example, these three steps may be accomplished in 32-bit x86 assembly language by the following instructions: mov esp, ebp pop ebp ret Like the prologue, the x86 processor contains a built-in instruction which performs part of the epilogue. The following code is equivalent to the above code: leave ret The leave instruction performs the mov and pop instructions, as outlined above. A function may contain multiple epilogues. Every function exit point must either jump to a common epilogue at the end, or contain its own epilogue. Therefore, programmers or compilers often use the combination of leave and ret to exit the function at any point. (For example, a C compiler would substitute a return statement with a leave/ret sequence). Further reading Subroutines Assembly languages