汇编指令小本本
 
 
目录
 
 
1、 数据传送指令
 
1.1 mov
 
 
(1) CPU内部寄存器之间的数据传送,如:mov ah,al
 
(2) 立即数送至通用寄存器(非段寄存器)或存储单元,如:mov al,3        mov [bx],1234h
 
(3) 寄存器与存储器间的数据传送,如:mov ax,var        mov ax,[bx]
注:都是从右向左传递
 
1.2 xchg
 
 
xchg OPRD1,OPRD2    OPRD可以是通用寄存器或存储单元,但不包括段寄存器,不能同时是存储单元,不能有立即数
 
1.3 地址传送
 
 
lea ax,[si+2]
 
 
lds si,FARPOINTER	; 32位双字变量
 
 
les reg,oprd
 
2、 堆栈操作指令
 
2.1 push
 
 
push src	 
 
2.2 pop
 
 
pop dst		
 
3、 标志性操作指令
 
 
3.1 LAHF
 
LAHF		
 
3.2 SAHF
 
SAHF		
 
3.3 PUSHF
 
PUSHF 		
 
3.4 POPF
 
POPF		
 
 
(1) CLC(Clear Carry Flag):                CF置0
(2) STC(Set Carry Flag):                CF置1
 
(3) CMC(Complement Carry Flag):            CF取反
 
(4) CLD(Clear Direction Flag):            DF置0,执行串操作指令时,地址递增
(5) STD(Set Direction Flag):            DF置1,执行串操作指令时,地址递减
 
(6) CLI(Clear Interrupt enable Flag)    IF置0,使CPU不响应来自外部装置的可屏蔽中断,但对不可屏蔽中断和内部中断没有影响
(7) STI(Set Interrupt enable Flag)        IF置1,可以响应可屏蔽中断
 
4、 加减运算指令
 
4.1 add
 
 
add OPRD1,OPRD2		
 
4.2 adc
 
 
add OPRD1,OPRD2 		
 
4.3 inc
 
 
inc OPRD		
 
4.4 sub
 
 
sub OPRD1,OPRD2			
 
4.5 sbb
 
 
sbb OPRD1,OPRD2			
 
4.6 dec
 
 
dec OPRD		
 
4.7 neg
 
 
neg OPRD			
 
4.8 cmp
 
 
cmp OPRD1,OPRD2			
 
5、 乘除运算指令
 
5.1 mul
 
 
mul OPRD			
 
5.2 imul
 
 
imul OPRD			
 
5.3 div
 
 
div OPRD			
 
5.4 idiv
 
 
idiv OPRD 			
 
5.5 cbw
 
 
cbw 			
 
5.6 cwd
 
 
cbw 			
 
6、 逻辑运算和位移运算指令
 
6.1 not
 
 
not OPRD			
 
6.2 and
 
 
and OPRD1,OPRD2			
 
6.3 or
 
 
or OPRD1,OPRD2			
 
6.4 xor
 
 
xor OPRD1,OPRD2			
 
6.5 test
 
 
test OPRD1,OPRD2
 
 
6.6 sal/shl
 
 
sal OPRD,m
shl OPRD,m			
 
6.7 sar
 
 
sar OPDR,m			
 
6.8 shr
 
 
shr OPRD,m			
 
 
6.9 rol\ror\rcl\rcr
 
 
rol OPRD,m
ror OPRD,m
rcl OPRD,m
rcr OPRD,m
 
7、 转移指令
 
7.1 jmp
 
jmp OPRD		
jmp far ptr 标号 		
jmp OPRD		
 
7.2 loop
 
 
loop 标号			
 
7.3 loope/loopz
 
 
loope	标号
loopz 	标号
 
7.4 loopne/loopnz
 
 
loopne	标号
loopnz	标号