【发布时间】:2021-01-15 05:16:46
【问题描述】:
int x=1;
int y=2;
int z=3;
变成
movl $1, -4(%rbp)
movl $2, -8(%rbp)
movl $3, -12(%rbp)
-4,-8,-12 是什么意思? 为什么是4分? 4 字节 = 32 位?
【问题讨论】:
标签: assembly x86-64 att addressing-mode
int x=1;
int y=2;
int z=3;
变成
movl $1, -4(%rbp)
movl $2, -8(%rbp)
movl $3, -12(%rbp)
-4,-8,-12 是什么意思? 为什么是4分? 4 字节 = 32 位?
【问题讨论】:
标签: assembly x86-64 att addressing-mode
-4 / -8 / -12 字节相对于rbp 中保存的地址,即pointer to the top of the stack(向下增长)。 4 字节/32 位,因为这是您机器上 int 的大小。
【讨论】: