Monday, February 29, 2016

8051 Instruction Opcode

Opcode in Hexadecimal & Binary

  • A, Acc: Accumulator
  • B: B special function register
  • C: Carry flag in PSW
  • Rn: Register R7-R0 of the currently selected Register Bank.
  • dir: 8-bit internal data location’s address. This could be an Internal Data RAM location (0-127) or a SFR [i.e., I/O port, control register, status register, etc. (128-255)]. Direct Addressing Mode.
  • @Ri : 8-bit internal data RAM location (0-255) addressed indirectly through register R1or R0. Indirect Addressing Mode.
  • #data: 8-bit constant included in instruction. Immediate Addressing Mode.
  • #data 16: 16-bit constant included in instruction. Immediate Addressing Mode.
  • addr 16: 16-bit destination address. Used by LCALL and LJMP. A branch can be anywhere within the 64K byte Program Memory address space. Long Addressing Mode.
  • addr 11: 11-bit destination address. Used by ACALL and AJMP. The branch will be within the same 2K byte page of program memory as the first byte of the following instruction. Absolute Addressing Mode.
  • rel: Signed (two’s complement) 8-bit offset byte. Used by SJMP and all conditional jumps. Range is -128 to +127 bytes relative to first byte of the following instruction. Relative Addressing Mode.
  • bit: Direct Addressed bit in Internal Data RAM or Special Function Register
  • 1B: 1 byte
    2B: 2 byte
    3B: 3 byte
    1C: 1 cycle
    2C: 2 cycles
    4C: 4 cycles
    P: oscillator Period
01000000012AJMP code addr
02000000103LJMP code addr
03000000111RR A
04000001001INC A
05000001012INC data addr
06000001101INC @R0
07000001111INC @R1
08000010001INC R0
09000010011INC R1
0A000010101INC R2
0B000010111INC R3
0C000011001INC R4
0D000011011INC R5
0E000011101INC R6
0F000011111INC R7
10000100003JBC bit addr,
code addr (rel)
11000100012ACALL code addr
12000100103LCALL code addr
13000100111RRC A
14000101001DEC A
15000101012DEC data addr
16000101101DEC @R0
17000101111DEC @R1
18000110001DEC R0
19000110011DEC R1
1A000110101DEC R2
1B000110111DEC R3
1C000111001DEC R4
1D000111011DEC R5
1E000111101DEC R6
1F000111111DEC R7
20001000003JB bit addr,
code addr (rel)
21001000012AJMP code addr
23001000111RL A
24001001002ADD A, #data
25001001012ADD A,data addr
26001001101ADD A,@R0
27001001111ADD A,@R1
28001010001ADD A,R0
29001010011ADD A,R1
2A001010101ADD A,R2
2B001010111ADD A,R3
2C001011001ADD A,R4
2D001011011ADD A,R5
2E001011101ADD A,R6
2F001011111ADD A,R7
30001100003JNB bit addr
,code addr (rel)
31001100012ACALL code addr
33001100111RLC A
34001101002ADDC A, #data
35001101012ADDC A,data addr
36001101101ADDC A,@R0
37001101111ADDC A,@R1
38001110001ADDC A,R0
39001110011ADDC A,R1
3A001110101ADDC A,R2
3B001110111ADDC A,R3
3C001111001ADDC A,R4
3D001111011ADDC A,R5
3E001111101ADDC A,R6
3F001111111ADDC A,R7
40010000002JC code addr
41010000012AJMP code addr
42010000102ORL data addr (direct)
43010000113ORL data addr (direct)
,#data (immediate)
44010001002ORL A, #data
45010001012ORL A,data addr
46010001101ORL A,@R0
47010001111ORL A,@R1
48010010001ORL A,R0
49010010011ORL A,R1
4A010010101ORL A,R2
4B010010111ORL A,R3
4C010011001ORL A,R4
4D010011011ORL A,R5
4E010011101ORL A,R6
4F010011111ORL A,R7
50010100002JNC code addr
51010100012ACALL code addr
52010100102ANL data addr (direct)
53010100113ANL data addr(direct)
54010101002ANL A, #data
55010101012ANL A,data addr
56010101101ANL A,@R0
57010101111ANL A,@R1
58010110001ANL A,R0
59010110011ANL A,R1
5A010110101ANL A,R2
5B010110111ANL A,R3
5C010111001ANL A,R4
5D010111011ANL A,R5
5E010111101ANL A,R6
5F010111111ANL A,R7
60011000002JZ code addr
61011000012AJMP code addr
62011000102XRL data addr (direct)
63011000113XRL data addr (direct)
,#data (immediate)
64011001002XRL A, #data
65011001012XRL A,data addr
66011001101XRL A,@R0
67011001111XRL A,@R1
68011010001XRL A,R0
69011010011XRL A,R1
6A011010101XRL A,R2
6B011010111XRL A,R3
6C011011001XRL A,R4
6D011011011XRL A,R5
6E011011101XRL A,R6
6F011011111XRL A,R7
70011100002JNZ code addr
71011100012ACALL code addr
72011100102ORL C,bit addr
73011100111JMP @A+DPTR
74011101002MOV A,#data
75011101013MOV data addr(direct),
#data (immediate)
76011101102MOV @R0,#data
77011101112MOV @R1,#data
78011110002MOV R0,#data
79011110012MOV R1,#data
7A011110102MOV R2,#data
7B011110112MOV R3,#data
7C011111002MOV R4,#data
7D011111012MOV R5,#data
7E011111102MOV R6,#data
7F011111112MOV R7,#data
80100000002SJMP code addr
81100000012AJMP code addr
82100000102ANL C,bit addr
83100000111MOVC A,@A+PC
84100001001DIV AB
85100001013MOV data addr (direct)
,data addr (direct)
86100001102MOV data addr (direct)
87100001112MOV data addr (direct)
88100010002MOV data addr (direct)
89100010012MOV data addr (direct)
8A100010102MOV data addr (direct)
8B100010112MOV data addr (direct)
8C100011002MOV data addr (direct)
8D100011012MOV data addr (direct)
8E100011102MOV data addr (direct)
8F100011112MOV data addr (direct)
90100100003MOV DPTR,#data16
91100100012ACALL code addr
92100100102MOV bit addr,C
93100100112MOVC A,@A+DPTR
94100101002SUBB A,#data
95100101011SUBB A,data addr
96100101101SUBB A,@R0
97100101111SUBB A,@R1
98100110001SUBB A,R0
99100110011SUBB A,R1
9A100110101SUBB A,R2
9B100110111SUBB A,R3
9C100111001SUBB A,R4
9D100111011SUBB A,R5
9E100111101SUBB A,R6
9F100111111SUBB A,R7
A0101000002ORL C,/bit addr
A1101000012AJMP code addr
A2101000102MOV C,bit addr
A3101000111INC DPTR
A4101001001MUL AB
A6101001102MOV @R0,data addr
A7101001112MOV @R1,data addr
A8101010002MOV R0,data addr
A9101010012MOV R1,data addr
AA101010102MOV R2,data addr
AB101010112MOV R3,data addr
AC101011002MOV R4,data addr
AD101011012MOV R5,data addr
AE101011102MOV R6,data addr
AF101011112MOV R7,data addr
B0101100002ANL C,/bit addr
B1101100012ACALL code addr
B2101100102CPL bit addr
B3101100111CPL C
B4101101003CJNE A,#data
(immediate),code addr
B5101101013CJNE A,data addr
(direct),code addr
B6101101103CJNE @R0,#data
(immediate),code addr
B7101101113CJNE @R1,#data
(immediate),code addr
B8101110003CJNE R0,#data
(immediate),code addr
B9101110013CJNE R1,#data
(immediate),code addr
BA101110103CJNE R2,#data
(immediate),code addr
BB101110113CJNE R3,#data
(immediate),code addr
BC101111003CJNE R4,#data
(immediate),code addr
BD101111013CJNE R5,#data
(immediate),code addr
BE101111103CJNE R6,#data
(immediate),code addr
BF101111113CJNE R7,#data
(immediate),code addr
C0110000002PUSH data addr
C1110000012AJMP code addr
C2110000102CLR bit addr
C3110000111CLR C
C4110001001SWAP A
C5110001012XCH A,data addr
C6110001101XCH A,@R0
C7110001111XCH A,@R1
C8110010001XCH A,R0
C9110010011XCH A,R1
CA110010101XCH A,R2
CB110010111XCH A,R3
CC110011001XCH A,R4
CD110011011XCH A,R5
CE110011101XCH A,R6
CF110011111XCH A,R7
D0110100002POP data addr
D1110100012ACALL code addr
D2110100102SETB bit addr
D3110100111SETB C
D4110101001DA A
D5110101013DJNZ data addr
(direct),code addr
D6110101101XCHD A,@R0
D7110101111XCHD A,@R1
D8110110002DJNZ R0,code addr
D9110110012DJNZ R1,code addr
DA110110102DJNZ R2,code addr
DB110110112DJNZ R3,code addr
DC110111002DJNZ R4,code addr
DD110111012DJNZ R5,code addr
DE110111102DJNZ R6,code addr
DF110111112DJNZ R7,code addr
E0111000001MOVX A,@DPTR
E1111000012AJMP code addr
E2111000101MOVX A,@R0
E3111000111MOVX A,@R1
E4111001001CLR A
E5111001012MOV A,data addr
E6111001101MOV A,@R0
E7111001111MOV A,@R1
E8111010001MOV A,R0
E9111010011MOV A,R1
EA111010101MOV A,R2
EB111010111MOV A,R3
EC111011001MOV A,R4
ED111011011MOV A,R5
EE111011101MOV A,R6
EF111011111MOV A,R7
F0111100001MOVX @DPTR,A
F1111100012ACALL code addr
F2111100101MOVX @R0,A
F3111100111MOVX @R1,A
F4111101001CPL A
F5111101012MOV data addr
F6111101101MOV @R0,A
F7111101111MOV @R1,A
F8111110001MOV R0,A
F9111110011MOV R1,A
FA111110101MOV R2,A
FB111110111MOV R3,A
FC111111001MOV R4,A
FD111111011MOV R5,A
FE111111101MOV R6,A
FF111111111MOV R7,A

Related topics:
8051 Instruction Set Overview   |   8051 Instruction Cycle   |   8051 Machine Cycle   |   8051 Instruction Set Summary   |   8051 Arithmetic Operation Instructions   |   8051 Logical Operation Instructions   |   8051 Data Transfer Instructions   |   8051 Boolean Variable Manipulation Instructions   |   8051 Program Branching Instructions   |   8051 Instructions that Affect Flag Settings   |   8051 Instructions and Examples

List of topics: 8051

No comments:

Post a Comment