3 Dec 2002 04:41
stack allocation for array
<Sameer.Seth <at> lntinfotech.com>
2002-12-03 03:41:36 GMT
2002-12-03 03:41:36 GMT
hi,
could somebody help me out with this confusion. i wrote a C program and
had an assembly output for that program by giving gcc -S option. the C
program is something like this:
int main()
{
int fd[3];
int pid = 0;
return 0;
}
+++++++++++++++=+++++++++++++++++++++++=++++++++++++++++++++++++++++++=+++++++++++++++++++++++++++++=+++++++++++++++++++++++==
the .s file created is like this:
.file "test_1.c"
.version "01.01"
gcc2_compiled.:
.text
.align 4
.globl main
.type main, <at> function
main:
pushl %ebp
movl %esp, %ebp
subl $40,
%esp-----------------------------------------------------> (why has the
compiler allocated this much space for the
two local variables which would
combinely would have taken 12 bytes)
movl $0, -28(%ebp)
(Continue reading)
RSS Feed