EBP ESP in x86

 
Raymond  draws a clear diagram showing how function call in x86 is done.
 
 
note
===
register ESP: Extened Stack Pointer. push, pop,call, ret uses this register.
register EBP: Frame Pointer. It is used to access any data higher or lower than it such as [EBP+4] is the return address ( ret will copy this to EIP).
[EBP+8] is the param1, etc.
[EBP-4] is local var 1, etc.
 
 
Advertisements
This entry was posted in system. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s