AT T組合語言筆記

2021-08-23 13:14:02 字數 930 閱讀 2708

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

組合語言 AT T組合語言

這兩天的pwn題環境都是在linux中,採用的組合語言是 at t 格式。之前學習的是intel格式的8086彙編,今天學習了下at t組合語言。基於x86 架構的處理器所使用的彙編指令一般有兩種格式 操作intel格式at t格式 暫存器命名 push eax pushl eax 常數 立即運算元...

AT T組合語言

at t彙編和8086組合語言雖然兩者很相似,但是還是不能根據8086的語法規則來讀at t彙編的吧,所以還是要看看at t彙編的語法規則,因為在讀核心 時,跟硬體打交道的部分 是用at t彙編編寫的,所以不可避免的會遇到at t彙編,下面先來看看at t彙編的語法規則吧。一 大小寫 intel格式...

AT T 組合語言學習筆記一

一 開發環境 centos 5.6 二 硬體 intel i5 64位 三 開發工具 1 gnu彙編器 gas 將組合語言源代友轉換為處理器指令碼 as o test.o test.s 2 連 鏈 接器 解析程式 中宣告的所有定義好的函式和記憶體位址標籤 ld o test test.o 3 偵錯程...