51匯編語(yǔ)言指令集
符號(hào)
Rn
Direct
SFR
@Ri
#data
#data16
Addr16
Addr11
Rel
bit
指令介紹
指令
數(shù)據(jù)轉(zhuǎn)移指令
50.MOV A,Rn
51.MOV A,direct
52.MOV A,@Ri
53.MOV A,#data
54.MOV Rn,A
55.MOV Rn,direct
56.MOV Rn,gdata
57.MOV direct,A
58.MOV direct,Rn
59.MOV direct1, direct2
60.MOV direct,@Ri
61.MOV direct,#data
62.MOV @Ri,A
63.MOV @Ri,direct
64.MOV @Ri,#data
65.MOV DPTR,#data16
66.MOVC A,@A+DPTR
67.MOVC A,@A+PC
68.MOVX A,@Ri
69.MOVX A,@DPTR
70.MOVX @Ri,A
71.MOVX @DPTR,A
72.PUSH direct
73.POP direct
74.XCH A,Rn
75.XCH A,direct
76.XCH A,@Ri
77.XCHD A,@Ri
算數(shù)運(yùn)算指令
1.ADD A,Rn
2.ADD A,direct
3.ADD A,@Ri
4.ADD A,#data
5.ADDC A,Rn
6.ADDC A,direct
7.ADDC A,@Ri
8.ADDC A,#data
9.SUBB A,Rn
10.SUBB A,direct
11.SUBB A,@Ri
12.SUBB A,#data
13.INC A
14.INC Rn
15.INC direct
16.INC @Ri
17.INC DPTR
說(shuō)明:將16位的DPTR加1,當(dāng)DPTR的低字節(jié)(DPL)從FFH溢出至00H時(shí),會(huì)使高字節(jié)(DPH)加1,不影響任何標(biāo)志位
18.DEC A
19.DEC Rn
20.DEC direct
21.DEC @Ri
22.MUL AB
說(shuō)明:將累加器A和寄存器B內(nèi)的無(wú)符號(hào)整數(shù)相乘,產(chǎn)生16位的積,低位字節(jié)存入A,高位字節(jié)存入B寄存器。如果積大于FFH,則溢出標(biāo)志位(OV)被設(shè)定為1,而進(jìn)位標(biāo)志位為0
23.DIV AB
說(shuō)明:無(wú)符號(hào)的除法運(yùn)算,將累加器A除以B寄存器的值,商存入A,余數(shù)存入B。執(zhí)行本指令后,進(jìn)位位(C)及溢出位(OV)被清除為0
24.DA A
若(A) 3-0>9或(AC)=1,則(A) 3-0←(A)3-0+6
若(A) 7-4>9或 (C)=1,則(A) 7-4←(A)7-4+6
邏輯運(yùn)算指令
25.ANL A,Rn
26.ANL A,direct
27.ANL A,@Ri
28.ANL A,#data
29.ANL direct,A
30.ANL direct,#data
31.ORL A,Rn
32.ORL A,direct
33.ORL A,@Ri
34.ORL A,#data
35.ORL direct,A
36.ORL direct,#data
37.XRL A,Rn
38.XRL A,direct
39.XRL A,@Ri
40.XRL A,#data
41.XRL direct,A
42.XRL direct,#data
43.CLR A
44.CPL A
45.RL A
46.RLC A
47.RR A
48.RRC A
49.SWAP A
布爾代數(shù)運(yùn)算
78.CLR C
79.CLR bit
80.SETB C
81.SETB bit
82.CPL C
83.CPL bit
84.ANL C,bit
85.ANL C,/bit
86.ORL C,bit
87.ORL C,/bit
88.MOV C,bit
89.MOV bit,C
90.JC rel
91.JNC rel
92.JB bit,rel
93.JNB bit,rel
94.JBC bit,rel
程序跳躍
95.ACALL addr11
96.LCALL addr16
97.RET
98.RETI
99.AJMP addr11
100.LJMP addr16
101.SJMP rel
102.JMP @A+DPTR
103.JZ rel
104.JNZ rel
105.CJNE A,direct,rel
106.CJNE A,#data,rel
107.CJNE @Rn,#data,rel
108.CJNE @Ri,#data,rel
109.DJNZ Rn,rel
110.DJNZ direct,rel
111.NOP
掌握常用的匯編語(yǔ)言偽指令及其應(yīng)用
1、匯編起始偽指令ORG
格式 :[標(biāo)號(hào):]ORG 16位地址
例 : ORG 0050H
MAIN: MOV SP,#50H
-----------
2、匯編結(jié)束偽指令END
格式 :[標(biāo)號(hào):]END [表達(dá)式]
3、字節(jié)數(shù)據(jù)定義偽指令DB
格式 :[標(biāo)號(hào):]DB D1,D2,.....
例 : DB "How are you!"
DB -2,-4,-6,8,10,18
4、字定義偽指令DW
格式 :[標(biāo)號(hào):]DW 16位數(shù)據(jù)表
例 : ORG 1000H
WORD: DW 324AH,3CH
匯編后 :(1000H)=32H,(1001H)=4AH
(1002H)=00H,(1003H)=3CH
5、空間定義偽指令DS
ORG 3000H
BUF: DS 50
............
6、賦值偽指令EQU
格式 :符號(hào)名EQU表達(dá)式
COOLER EQU P1.0
HEATER EQU P1.2
VALUE EQU 40H
........
SETB COOLER
CLR HEATER
MOV VALUE,A
7、位地址符號(hào)定義偽指令BIT
QIDONG BIT P1.0
FLAG BIT 20H
功能:將位地址賦予所規(guī)定的字符名稱(chēng)
評(píng)論