AT&T尋址

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:立即數尋址

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章