| 32bits | 64 bits | 功能 |
|---|---|---|
EAX |
RAX |
累加暫存 |
EBX |
RBX |
基底暫存 |
ECX |
RCX |
計數器 |
EDX |
RDX |
來源(source)的索引 |
64位元的暫存器效率比32位元好
ESI, EDI 索引暫存器
EBP, ESP
CS、SS、ES、DS
flag
Little-endian v.s. Big-endian
Little-endian:
Big-endian
參考自:https://blog.gtwang.org/programming/difference-between-big-endian-and-little-endian-implementation-in-c/
MOV
mov eax, temp
MOVZX
movzx eax, tmp
push, pop
push eax
pop eax
ADD, SUB
add eax, temp
sub eax, temp
CMP
cmp eax, ebx
AND
and eax, temp
OR
or eax, temp
XOR
xor eax, temp
TEST
test eax, temp
Jmp [地址] 無條件轉移(JUMP)
jz, je 等於時跳轉
mov eax, 10
mov ebx, 20
cmp eax, ebx
je hello
;b
hello:
; a
jnz, jne 不等於時跳轉
mov eax, 10
mov ebx, 20
cmp eax, ebx
jne aaa
;equal state
aaa:
;not equal state
call
ret
push 2
push 1
call qq
push ebp
mov ebp,esp
sub esp,4
mov [ebp-4],5
mov esp,ebp
pop ebp
ret (pop eip)
add esp,8
有興趣的捧油可以自行研究