stack pointer instructions in subroutine

Andrew Haley aph-gcc@littlepinkcloud.COM
Thu Aug 9 16:14:00 GMT 2007


Anitha Boyapati writes:
 >   As far as I know, arguments are pushed onto the stack before entering
 >   a subroutine. Hence ebp makes sense. From here onwards, I feel lame.
 >   Summarizing :
 > 
 > 	1. Why should subl $8 and sub $12 from esp happen ?
 > 
 > 	2. After the call to constructor, why are 16 bytes being poped 
 > 	   off? According to me, only 4 bytes (  for another round of ebp 
 > 	   in constructor) should be popped off.
 > 
 >   I could be missing some basic details which are what I am after.
 >   Any help appreciated.

The stack is always 16-aligned.  It's faster that way.

Andrew.



More information about the Gcc-help mailing list