080483b4 <main>:
int main()
{
80483b4: 55 push %ebp
80483b5: 89 e5 mov %esp,%ebp
80483b7: 83 ec 10 sub $0x10,%esp
int a=10;
80483ba: c7 45 fc 0a 00 00 00 movl $0xa,-0x4(%ebp)
int *p=&a;
80483c1: 8d 45 fc lea -0x4(%ebp),%eax
80483c4: 89 45 f8 mov %eax,-0x8(%ebp)
int b=*p;
80483c7: 8b 45 f8 mov -0x8(%ebp),%eax
80483ca: 8b 00 mov (%eax),%eax
80483cc: 89 45 f4 mov %eax,-0xc(%ebp)
return b;
80483cf: 8b 45 f4 mov -0xc(%ebp),%eax
}
objdump -dS ./a.out
lea -0x4(%ebp),%eax
mov %eax,-0x8(%ebp)
lea 和 mov的区别:lea取地址
-0x8(%ebp):基址寻址
(%eax):间接寻址
%eax:可以看作寄存器寻址,和内存地址不在一个地址空间
$0xa:立即数寻址