March 2010
Beginner
760 pages
18h 51m
English
Before a procedure returns to its caller, it needs to clean up the activation record. Although it is possible to share the cleanup duties between the procedure and the procedure's caller, Intel has included some features in the instruction set that allows the procedure to efficiently handle all the cleanup chores itself. Standard HLA procedures and procedure calls, therefore, assume that it is the procedure's responsibility to clean up the activation record (including the parameters) when the procedure returns to its caller.
If a procedure does not have any parameters, the exit sequence is very simple. It requires only three instructions:
mov( ebp, esp ); // Deallocate locals and clean up stack. pop( ebp ); // Restore ...