彙編指令一覽表

彙編指令的英文全稱
如果你想寫系統軟件,兩本入門書籍 -- 譚浩強的《C 語言程序設計》和王爽的《彙編語言》是必看的。譚老的 C 語言已相當成熟,王老師的彙編倒有個小缺陷—指令沒有英文全稱,或許他認為現在學編程的朋友都不記單詞,如同新生代作家看不懂英文原著一般。不過我覺得記住指令的英文全稱,就不容易搞混,印象會更深刻,所以我把王爽書中出現的英文縮寫的全稱羅列出來,以便入門的朋友更好地記住它們。


8086CPU 提供以下幾大類指令。
一、數據傳送指令
比如,mov(move)、push、pop、pushf(push flags)、popf(pop flags)、xchg(exchange)等都是數據傳送指令,這些指令實現寄存器和內存、寄存器和寄存器之間的單個數據傳送。
二、算術運算指令
比如,add、sub(substract)、adc(add with carry)、sbb(substract with borrow)、inc(increase)、dec(decrease)、cmp(compare)、imul(integer multiplication)、idiv(integer divide)、aaa(ASCII add with adjust)等都是算術運算指令,這些指令實現寄存器和內存中的數據運算。它們的執行結果影響標誌寄存器的 sf、zf、of、cf、pf、af 位。
三、邏輯指令
比如,and、or、not、xor(exclusive or)、test、shl(shift logic left)、shr(shift logic right)、sal(shift arithmetic left)、sar(shift arithmetic right)、rol(rotate left)、ror(rotate right)、rcl(rotate left through carry)、rcr(rotate right through carry)等都是邏輯指令。除了 not 指令外,它們的執行結果都影響標誌寄存器的相關標誌位。

本帖隱藏的內容

四、轉移指令
可以修改 IP,或同時修改 CS 和 IP 的指令統稱為轉移指令。轉移指令分為以下幾類。
(1) 無條件轉移指令,比如,jmp(jump);
(2) 條件轉移指令,比如,jcxz(jump if CX is zero)、je(jump if equal)、jb(jump if below)、ja(jump if above)、jnb(jump if not below)、jna(jump if not above)等;
(3) 循環指令,比如,loop;


(4) 過程,比如,call、ret(return)、retf(return far);
(5) 中斷,比如,int(interrupt)、iret(interrupt return)。
五、處理機控制指令
這些指令對標誌寄存器或其他處理機狀態進行設置,比如,cld(clear direction)、std(set direction)、cli(clear interrupt)、sti(set interrupt)、nop(no operation)、clc(clear carry)、cmc(carry make change)、stc(set carry)、hlt(halt)、wait、esc(escape)、lock 等都是處理機控制指令。
六、串處理指令
這些指令對內存中的批量數據進行處理,比如,movsb(move string byte)、movsw(move string word)、cmps(compare string)、scas(scan string)、lods(load string)、stos(store string)等。若要使用這些指令方便地進行批量數據處理,則需要和 rep(repeat)、repe(repeat if equal)、repne(repeat if not equal)等前綴指令配合使用。
附:8086CPU 寄存器英文全稱
1、通用寄存器
AX(accumulator)、BX(base)、CX(count)、DX(data)這些寄存器可以字(16 位)或字節(8 位)單位形式訪問;
SP(stack pointer)、BP(base pointer)、SI(source index)、DI(destination index),這些寄存器只能以字(16 位)單位形式訪問。
2、專用寄存器
IP(instruction pointer)、SP(stack pointer);;
FLAGS 又稱 PSW(program status word) 分為:
① 條件碼
OF(overflow)、SF(sign)、ZF(zero)、CF(carry)、AF(auxiliary)、PF(parity)
② 控制標誌
DF(direction)
③ 系統標誌位

TF(trap)、IF(interrupt)、IOPL(I/O privilege level)
3、段寄存器
CS(code)、DS(data)、SS(stack)、ES(extra)
彙編指令的英文全稱
一、數據傳送指令
1. 通用數據傳送指令.
MOV----> move
MOVSX---->extended move with sign data
MOVZX---->extended move with zero data
PUSH---->push
POP---->pop
PUSHA---->push all
POPA---->pop all
PUSHAD---->push all data
POPAD---->pop all data
BSWAP---->byte swap
XCHG---->exchange
CMPXCHG---->compare and change
XADD---->exchange and add
XLAT---->translate
2. 輸入輸出端口傳送指令.
IN---->input
OUT---->output
3. 目的地址傳送指令.
LEA---->load effective address
LDS---->load DS
LES---->load ES
LFS---->load FS
LGS---->load GS
LSS---->load SS
4. 標誌傳送指令.
LAHF---->load AH from flag
SAHF---->save AH to flag
PUSHF---->push flag
POPF---->pop flag
PUSHD---->push dflag
POPD---->pop dflag
二、算術運算指令
ADD---->add
ADC---->add with carry
INC---->increase 1
AAA---->ascii add with adjust

DAA---->decimal add with adjust
SUB---->substract
SBB---->substract with borrow
DEC---->decrease 1
NEC---->negative
CMP---->compare
AAS---->ascii adjust on substract
DAS---->decimal adjust on substract
MUL---->multiplication
IMUL---->integer multiplication
AAM---->ascii adjust on multiplication
DIV---->divide
IDIV---->integer divide
AAD---->ascii adjust on divide
CBW---->change byte to word
CWD---->change word to double word
CWDE---->change word to double word with sign to EAX
CDQ---->change double word to quadrate word
三、邏輯運算指令
AND---->and
OR---->or
XOR---->xor Exclusive OR
NOT---->not
TEST---->test
SHL---->shift left
SAL---->arithmatic shift left 算術
SHR---->shift right
SAR---->arithmatic shift right
ROL---->rotate left
ROR---->rotate right
RCL---->rotate left with carry
RCR---->rotate right with carry
四、串指令
MOVS---->move string
CMPS---->compare string
SCAS---->scan string
LODS---->load string
STOS---->store string
REP---->repeat
REPE---->repeat when equal
REPZ---->repeat when zero flag
REPNE---->repeat when not equal
REPNZ---->repeat when zero flag
REPC---->repeat when carry flag
REPNC---->repeat when not carry flag
五、程序轉移指令
1 > 無條件轉移指令 (長轉移)

JMP---->jump
CALL---->call
RET---->return
RETF---->return far
2 > 條件轉移指令 (短轉移,-128 到 + 127 的距離內)
JAE---->jump when above or equal
JNB---->jump when not below
JB---->jump when below
JNAE---->jump when not above or equal
JBE---->jump when below or equal
JNA---->jump when not above
JG---->jump when greater
JNLE---->jump when not less or equal
JGE---->jump when greater or equal
JNL---->jump when not less
JL---->jump when less
JNGE---->jump when not greater or equal
JLE---->jump when less or equal
JNG---->jump when not greater
JE---->jump when equal
JZ---->jump when has zero flag
JNE---->jump when not equal
JNZ---->jump when not has zero flag
JC---->jump when has carry flag
JNC---->jump when not has carry flag
JNO---->jump when not has overflow flag
JNP---->jump when not has parity flag
JPO---->jump when parity flag is odd
JNS---->jump when not has sign flag
JO---->jump when has overflow flag
JP---->jump when has parity flag
JPE---->jump when parity flag is even
JS---->jump when has sign flag
3 > 循環控制指令 (短轉移)
LOOP---->loop
LOOPE---->loop equal
LOOPZ---->loop zero
LOOPNE---->loop not equal
LOOPNZ---->loop not zero
JCXZ---->jump when CX is zero
JECXZ---->jump when ECX is zero
4 > 中斷指令
INT---->interrupt
INTO---->overflow interrupt
IRET---->interrupt return
5 > 處理器控制指令
HLT---->halt

WAIT---->wait
ESC---->escape
LOCK---->lock
NOP---->no operation
STC---->set carry
CLC---->clear carry
CMC---->carry make change
STD---->set direction
CLD---->clear direction
STI---->set interrupt
CLI---->clear interrupt
六、偽指令
DW---->definw word
PROC---->procedure
ENDP---->end of procedure
SEGMENT---->segment
ASSUME---->assume
ENDS---->end segment
END---->end
Move)
MOVC (Move Code)
MOVX (Move External)
XCH (Exchange)
PUSH
POP
AJMP (Absolute Jump)
LJMP (Long Jump)
SJMP (Short Jump)
JMP (Jump Indirect)
JZ (Jump Zero)
JNZ (Jump Not Zero)
JC (Jump if Carry)
JNC (Jump if Not Carry)
JB (Jump if Bit is set)
JNB (Jump if Not Bit)
JBC (If Bit is set and Clear Bit)
CJNE (Compare and Jump if Not Equal)
DJNZ (Decrement and Jump if Not Zero)
ACALL (Absolute Call)
LCALL (Long Call)
RET (Return)
NOP (No Operation)
ADD
ADDC (Add with Carry)
SUBB (Substract with Borrow)
MUL (Multiply)
DIV (Divide)
INC (Increment)
DEC (Decrement)
ANL (Logical AND)

ORL (Logical OR)
XRL (Logical Exclusive OR)
CPL (Complement)
CLR (Clear)
SEBT (Set Bit)
RL (Rotate Left)
RR (Rotate Right)
RLC (Rotate Left throught the Carry flag)
RRC (Rotate Right throught the Carry flag)
XCHD
SWAP
DA (Decimal Adjust)
ORG (Origin)
DB (Define Byte)
DW (Define Word)
EQU (Equal)
DATA
XDATA (External Data)
BIT
END


彙編指令一覽表


分享到:


相關文章: