#include int main () { int a; int b; a = 1; b = 2; printf ("a + b = %d\n", a + b); return 0; } [ryand@Arch ryand]$ more z.s .file "z.c" .version "01.01" gcc2_compiled.: .section .rodata .LC0: .string "a + b = %d\n" .text .align 4 .globl main .type main,@function main: pushl %ebp movl %esp, %ebp subl $8, %esp movl $1, -4(%ebp) movl $2, -8(%ebp) subl $8, %esp movl -8(%ebp), %eax addl -4(%ebp), %eax pushl %eax pushl $.LC0 call printf addl $16, %esp movl $0, %eax leave ret .Lfe1: .size main,.Lfe1-main .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)" ------------------------------------------------------------------------ #include int Foo (int x, int y) { return x + y; } int main () { int a; int b; a = 1; b = 2; printf ("a + b = %d\n", Foo (a, b)); return 0; } [ryand@Arch ryand]$ more z.s .file "z.c" .version "01.01" gcc2_compiled.: .text .align 4 .globl Foo .type Foo,@function Foo: pushl %ebp movl %esp, %ebp subl $4, %esp movl 12(%ebp), %eax movl 8(%ebp), %edx addl %eax, %edx movl %edx, -4(%ebp) movl -4(%ebp), %eax leave ret .Lfe1: .size Foo,.Lfe1-Foo .section .rodata .LC0: .string "a + b = %d\n" .text .align 4 .globl main .type main,@function main: pushl %ebp movl %esp, %ebp subl $24, %esp movl $1, -4(%ebp) movl $2, -8(%ebp) subl $8, %esp pushl -8(%ebp) pushl -4(%ebp) call Foo addl $8, %esp movl %eax, -12(%ebp) pushl -12(%ebp) pushl $.LC0 call printf addl $16, %esp movl $0, %eax leave ret .Lfe2: .size main,.Lfe2-main .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)" ------------------------------------------------------------------------