prompt> more main.c #include int main ( void ) { int a = 5; int b = 3; int c = sum(a,b); printf("%d + %d = %d\n",a,b,c); return 0; } prompt> more sub.c int sum (int x, int y) { int t = x + y; return t; } prompt> gcc -g -m32 -O0 main.c sub.c 0804841d
: 804841d: 55 push %ebp 804841e: 89 e5 mov %esp,%ebp 8048420: 83 e4 f0 and $0xfffffff0,%esp 8048423: 83 ec 20 sub $0x20,%esp 8048426: c7 44 24 14 05 00 00 movl $0x5,0x14(%esp) 804842d: 00 804842e: c7 44 24 18 03 00 00 movl $0x3,0x18(%esp) 8048435: 00 8048436: 8b 44 24 18 mov 0x18(%esp),%eax 804843a: 89 44 24 04 mov %eax,0x4(%esp) 804843e: 8b 44 24 14 mov 0x14(%esp),%eax 8048442: 89 04 24 mov %eax,(%esp) 8048445: e8 2f 00 00 00 call 8048479 804844a: 89 44 24 1c mov %eax,0x1c(%esp) 804844e: 8b 44 24 1c mov 0x1c(%esp),%eax 8048452: 89 44 24 0c mov %eax,0xc(%esp) 8048456: 8b 44 24 18 mov 0x18(%esp),%eax 804845a: 89 44 24 08 mov %eax,0x8(%esp) 804845e: 8b 44 24 14 mov 0x14(%esp),%eax 8048462: 89 44 24 04 mov %eax,0x4(%esp) 8048466: c7 04 24 20 85 04 08 movl $0x8048520,(%esp) 804846d: e8 7e fe ff ff call 80482f0 8048472: b8 00 00 00 00 mov $0x0,%eax 8048477: c9 leave 8048478: c3 ret 08048479 : 8048479: 55 push %ebp 804847a: 89 e5 mov %esp,%ebp 804847c: 83 ec 10 sub $0x10,%esp 804847f: 8b 45 0c mov 0xc(%ebp),%eax 8048482: 8b 55 08 mov 0x8(%ebp),%edx 8048485: 01 d0 add %edx,%eax 8048487: 89 45 fc mov %eax,-0x4(%ebp) 804848a: 8b 45 fc mov -0x4(%ebp),%eax 804848d: c9 leave 804848e: c3 ret 804848f: 90 nop