This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Assembly Code Query
- From: "Alex J. Dam" <alexjotadam at yahoo dot com dot br>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 25 Feb 2005 21:20:45 -0300
- Subject: Re: Assembly Code Query
- References: <20050225233144.GA21179@ncd.cc.iitk.ac.in>
On Friday 25 February 2005 20:31, .jareeN. wrote:
> Hi all,
Hello.
> I am using gcc -S to generate this assembly code. The compiler
> gives:
>
> andl $-16, %esp
>
> I understand that we are here basically anding 0xffff00ff with %esp. But
-16 equals 0xfffffff0, not 0xffff00ff. So, by ANDing %esp with 0xfffffff0,
you're actually aligning it to a 16-byte boundary and, as the code you've
posted seems to be setting up a stack frame, this is no problem, since the
value of %esp will only decrease.
> what I can't get is use of doing this. Could somebody tell me the
> significance of doing this.
>
>
>
> Detailed code:
>
> pushl %ebp
> movl $16, %edx
> movl %esp, %ebp
> subl $8, %esp
> andl $-16, %esp
> movl %edx, 4(%esp)
>
>
> TIA