C????????????????
???????????? ???????[ 2015/3/9 14:33:30 ] ????????C ???? ???
????1. ???
?????????LINUX???????ε?????Σ?????????????????????????????????????????
????????????????????????????C????????α??????????????
????2. ??????????
?????????????д???????C?????????exp1.c:
1 #include <stdio.h>
2
3 int g(int x)
4 {
5 return x+3;
6 }
7
8 int f(x)
9 {
10 return g(x);
11 }
12
13 int main()
14 {
15 return f(8)+1;
16 }
?????????????????????????????????????????????
????1 gcc –S –o main.s main.c -m32
?????????????????????C??????????
1 .file "exp1.c"
2 .text
3 .globl g
4 .type g?? @function
5 g:
6 .LFB0:
7 .cfi_startproc
8 pushl %ebp
9 .cfi_def_cfa_offset 8
10 .cfi_offset 5?? -8
11 movl %esp?? %ebp
12 .cfi_def_cfa_register 5
13 movl 8(%ebp)?? %eax
14 addl $3?? %eax
15 popl %ebp
16 .cfi_def_cfa 4?? 4
17 .cfi_restore 5
18 ret
19 .cfi_endproc
20 .LFE0:
21 .size g?? .-g
22 .globl f
23 .type f?? @function
24 f:
25 .LFB1:
26 .cfi_startproc
27 pushl %ebp
28 .cfi_def_cfa_offset 8
29 .cfi_offset 5?? -8
30 movl %esp?? %ebp
31 .cfi_def_cfa_register 5
32 subl $4?? %esp
33 movl 8(%ebp)?? %eax
34 movl %eax?? (%esp)
35 call g
36 leave
37 .cfi_restore 5
38 .cfi_def_cfa 4?? 4
39 ret
40 .cfi_endproc
41 .LFE1:
42 .size f?? .-f
43 .globl main
44 .type main?? @function
45 main:
46 .LFB2:
47 .cfi_startproc
48 pushl %ebp
49 .cfi_def_cfa_offset 8
50 .cfi_offset 5?? -8
51 movl %esp?? %ebp
52 .cfi_def_cfa_register 5
53 subl $4?? %esp
54 movl $8?? (%esp)
55 call f
56 addl $1?? %eax
57 leave
58 .cfi_restore 5
59 .cfi_def_cfa 4?? 4
60 ret
61 .cfi_endproc
62 .LFE2:
63 .size main?? .-main
64 .ident "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3"
65 .section .note.GNU-stack??""??@progbits
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11