This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
not using push by gcc
- From: "Mr.reCoder" <mr dot recoder at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 2 Feb 2015 11:45:46 +0330
- Subject: not using push by gcc
- Authentication-results: sourceware.org; auth=none
Dear gcc developer,
I have a code like this:
#include <stdio.h>
void foo(int x)
{
int y;
x++;
y = 4;
}
int main(void)
{
foo(2);
return 0;
}
and compiled with "gcc -o outexec srcfile.c" command.
when disassemble the file we see that sending argument to function
"foo" is done by
--------------------------------------
sub esp, 4
mov dword ptr [esp], 2
call foo
--------------------------------------
instructions. why gcc doesn't use the "push" command like:
--------------------------------------
push 2
call foo
--------------------------------------
?
Sincerely.