mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 04:22:22 +00:00
64 lines
2.6 KiB
Plaintext
64 lines
2.6 KiB
Plaintext
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 |
|
|
| callee's BP |
|
|
| (if framepointer_enabled) |
|
|
+---------------------------+
|