forked from withlin/advanced-go-programming-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathch3-13-func-stack-frame-layout-01.ditaa.txt
63 lines (62 loc) · 2.56 KB
/
ch3-13-func-stack-frame-layout-01.ditaa.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Stack frame layout X86/AMD64
---=- +-=-------------------------+
^ | |
| | ret1 to caller |
| | |
| +-=-------------------------+<--ret1+24(FP)
| | |
: | ret0 to caller |
| |
argsize +-=-------------------------+<--ret0+16(FP)
| |
: | arg1 from caller |
| | |
| +-=-------------------------+<--arg1+8(FP)
| | |
| | arg0 from caller |
v | |
---=- +-=-------------------------+<--arg0+0(FP)
| |
| parent return address |
| |
+---------------------------+
| c9D5 |
| caller's BP |
| (if framepointer_enabled) |
---=- +---------------------------+<--BP(pseudo SP)
^ | cD0A |
| | local varable2 |
| | |
| +---------------------------+<--var2-8(SP)
| | cD0A |
| | local varable1 |
| | |
| +---------------------------+<--var1-16(SP)
| | cD0A |
| | local varable0 |
| | |
| +---------------------------+<--var0-24(SP)
: | cYEL |
| | ret1 from callee |
| |
framesize+---------------------------+<--24(SP)
| cYEL |
| | ret0 from callee |
: | |
| +---------------------------+<--16(SP)
| | cF51 |
| | arg1 to callee |
| | |
| +---------------------------+<--8(SP)
| | cF51 |
| | arg0 to callee |
v | |
---=- +---------------------------+<--0(SP)
| cAAA |
| return address |
| |
+---------------------------+
| cAAA |
| caller's BP |
| (if framepointer_enabled) |
+---------------------------+