AT&T組合語言筆記

來源:互聯網
上載者:User

1。在gcc產生的彙編中,$0x80498d4表示立即數,而0x80498d4表示記憶體位址0x80498d4對應的內容。對於lable,比如value,則$value表示value的地址,value表示value的值。設函數func的地址
&func = 0x8048828
這兩種調用都是一樣的
1) call 0x8048828
2) movl $0x8048828 %edx
    call *%edx

 2.如果寄存器存的是一個地址,就說這個寄存器是一個指標,加括弧表示取這個指標所指的對象

int w = 5;

movl &w %edx    //%edx = &w,%edx是一個指標

movl (%edx) %eax        //%eax = *&w = w = 5

 3.base_address(offset_address, index, size) = base_address + offset_address + index * size

 4.movb:取1個位元組,movw:取2個位元組,movl:取4個位元組

5.8個32bit的通用寄存器及其作用

EAX Accumulator for operands and results data

EBX Pointer to data in the data memory segment

ECX Counter for string and loop operations

EDX I/O pointer

EDI Data pointer for destination of string operations

ESI Data pointer for source of string operations

ESP Stack pointer

EBP Stack data pointer

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.