Re: Assembly Code Query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux