Skip to Content
The Art of Assembly Language, 2nd Edition
book

The Art of Assembly Language, 2nd Edition

by Randall Hyde
March 2010
Beginner content levelBeginner
760 pages
18h 51m
English
No Starch Press
Content preview from The Art of Assembly Language, 2nd Edition

5.15 The Standard Exit Sequence

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

x64 Assembly Language Step-by-Step, 4th Edition

x64 Assembly Language Step-by-Step, 4th Edition

Jeff Duntemann
C Programming Language, 2nd Edition

C Programming Language, 2nd Edition

Brian W. Kernighan, Dennis Ritchie

Publisher Resources

ISBN: 9781593272074Errata Page