https://blog.csdn.net/xr_acmer/article/details/37992749
https://blog.csdn.net/qq_20892953/article/details/122023099
lldb:https://www.jianshu.com/p/b405a437fb4e
1 2 3 4 5
| int main() { int a = 1; int b = a + 10; return b; }
|
1 2 3 4 5 6 7 8 9 10 11
| cplusplus_test`main: 0x102673340 <+0>: pushq %rbp 0x102673341 <+1>: movq %rsp, %rbp 0x102673344 <+4>: movl $0x0, -0x4(%rbp) -> 0x10267334b <+11>: movl $0x1, -0x8(%rbp) 0x102673352 <+18>: movl -0x8(%rbp), %eax 0x102673355 <+21>: addl $0xa, %eax 0x102673358 <+24>: movl %eax, -0xc(%rbp) 0x10267335b <+27>: movl -0xc(%rbp), %eax 0x10267335e <+30>: popq %rbp 0x10267335f <+31>: retq
|
- %xx 寄存器寻址
- $0x0 立即数寻址
- -0x4(%rbp) 基地址+偏移寻址
- (%rbp) 间接寻址
- 0x0 绝对寻址