8051 Instruction Set with Examples
Instruction | Example | |
---|---|---|
Mnemonic | Operands | |
NOP | NOP | |
AJMP | code addr (addr11) | AJMP JMPADR |
LJMP | code addr (addr16) | LJMP JMPADR |
RR | A | RR A |
INC | A | INC A |
INC | data addr (direct) | INC 34h |
INC | @R0 | INC @R0 |
INC | @R1 | INC @R1 |
INC | R0 | INC R0 |
INC | R1 | INC R1 |
INC | R2 | INC R2 |
INC | R3 | INC R3 |
INC | R4 | INC R4 |
INC | R5 | INC R5 |
INC | R6 | INC R6 |
INC | R7 | INC R7 |
JBC | bit addr, code addr (rel) | JBC ACC.3,LABEL1 |
ACALL | code addr (addr11) | ACALL SUBRTN |
LCALL | code addr (addr16) | LCALL SUBRTN |
RRC | A | RRC A |
DEC | A | DEC A |
DEC | data addr (direct) | DEC 35h |
DEC | @R0 | DEC @R0 |
DEC | @R1 | DEC @R1 |
DEC | R0 | DEC R0 |
DEC | R1 | DEC R1 |
DEC | R2 | DEC R2 |
DEC | R3 | DEC R3 |
DEC | R4 | DEC R4 |
DEC | R5 | DEC R5 |
DEC | R6 | DEC R6 |
DEC | R7 | DEC R7 |
JB | bit addr, code addr (rel) | JB P1.2,LABEL1 |
AJMP | code addr (addr11) | AJMP JMPADR |
RET | RET | |
RL | A | RL A |
ADD | A, #data (immediate) | ADD A, #03h |
ADD | A,data addr (direct) | ADD A, 20h |
ADD | A,@R0 | ADD A, @R0 |
ADD | A,@R1 | ADD A, @R1 |
ADD | A,R0 | ADD A, R0 |
ADD | A,R1 | ADD A, R1 |
ADD | A,R2 | ADD A, R2 |
ADD | A,R3 | ADD A, R3 |
ADD | A,R4 | ADD A, R4 |
ADD | A,R5 | ADD A, R5 |
ADD | A,R6 | ADD A, R6 |
ADD | A,R7 | ADD A, R7 |
JNB | bit addr, code addr (rel) | JNB P1.3,LABEL1 |
ACALL | code addr (addr11) | ACALL SUBRTN |
RETI | RETI | |
RLC | A | RLC A |
ADDC | A, #data (immediate) | ADDC A, #03h |
ADDC | A,data addr (direct) | ADDC A, 20h |
ADDC | A,@R0 | ADDC A, @R0 |
ADDC | A,@R1 | ADDC A, @R1 |
ADDC | A,R0 | ADDC A, R0 |
ADDC | A,R1 | ADDC A, R1 |
ADDC | A,R2 | ADDC A, R2 |
ADDC | A,R3 | ADDC A, R3 |
ADDC | A,R4 | ADDC A, R4 |
ADDC | A,R5 | ADDC A, R5 |
ADDC | A,R6 | ADDC A, R6 |
ADDC | A,R7 | ADDC A, R7 |
JC | code addr (rel) | JC LABEL1 |
AJMP | code addr (addr11) | AJMP JMPADR |
ORL | data addr (direct),A | ORL P0, A |
ORL | data addr (direct), #data (immediate) | ORL P0, #01h |
ORL | A, #data (immediate) | ORL A, #01h |
ORL | A,data addr (direct) | ORL A, P0 |
ORL | A,@R0 | ORL A, @R0 |
ORL | A,@R1 | ORL A, @R1 |
ORL | A,R0 | ORL A, R0 |
ORL | A,R1 | ORL A, R1 |
ORL | A,R2 | ORL A, R2 |
ORL | A,R3 | ORL A, R3 |
ORL | A,R4 | ORL A, R4 |
ORL | A,R5 | ORL A, R5 |
ORL | A,R6 | ORL A, R6 |
ORL | A,R7 | ORL A, R7 |
JNC | code addr (rel) | JNC LABEL1 |
ACALL | code addr (addr11) | ACALL SUBRTN |
ANL | data addr (direct),A | ANL 40h, A |
ANL | data addr(direct), #data(immediate) | ANL 30h, #77h |
ANL | A, #data (immediate) | ANL A, #3Fh |
ANL | A,data addr (direct) | ANL A, 40h |
ANL | A,@R0 | ANL A, @R0 |
ANL | A,@R1 | ANL A, @R1 |
ANL | A,R0 | ANL A, R0 |
ANL | A,R1 | ANL A, R1 |
ANL | A,R2 | ANL A, R2 |
ANL | A,R3 | ANL A, R3 |
ANL | A,R4 | ANL A, R4 |
ANL | A,R5 | ANL A, R5 |
ANL | A,R6 | ANL A, R6 |
ANL | A,R7 | ANL A, R7 |
JZ | code addr (rel) | JZ LABEL1 |
AJMP | code addr (addr11) | AJMP JMPADR |
XRL | data addr (direct),A | XRL 34h, A |
XRL | data addr (direct), #data (immediate) | XRL 34h, #0FFh |
XRL | A, #data (immediate) | XRL A, #0FFh |
XRL | A,data addr (direct) | XRL A, 34h |
XRL | A,@R0 | XRL A, @R0 |
XRL | A,@R1 | XRL A, @R1 |
XRL | A,R0 | XRL A, R0 |
XRL | A,R1 | XRL A, R1 |
XRL | A,R2 | XRL A, R2 |
XRL | A,R3 | XRL A, R3 |
XRL | A,R4 | XRL A, R4 |
XRL | A,R5 | XRL A, R5 |
XRL | A,R6 | XRL A, R6 |
XRL | A,R7 | XRL A, R7 |
JNZ | code addr (rel) | JNZ LABEL1 |
ACALL | code addr (addr11) | ACALL SUBRTN |
ORL | C,bit addr | ORL C, 22h |
JMP | @A+DPTR | JMP @A + DPTR |
MOV | A,#data (immediate) | MOV A, #0FFh |
MOV | data addr(direct), #data (immediate) | MOV P2, #0FFh |
MOV | @R0, #data (immediate) | MOV @R0, #10h |
MOV | @R1, #data (immediate) | MOV @R1, #10h |
MOV | R0, #data (immediate) | MOV R0, #10h |
MOV | R1, #data (immediate) | MOV R1, #10h |
MOV | R2, #data (immediate) | MOV R2, #10h |
MOV | R3, #data (immediate) | MOV R3, #10h |
MOV | R4, #data (immediate) | MOV R4, #10h |
MOV | R5, #data (immediate) | MOV R5, #10h |
MOV | R6, #data (immediate) | MOV R6, #10h |
MOV | R7, #data (immediate) | MOV R7, #10h |
SJMP | code addr (rel) | SJMP RELADR |
AJMP | code addr (addr11) | AJMP JMPADR |
ANL | C,bit addr | ANL C, 22h |
MOVC | A,@A+PC | MOV A, @A+PC |
DIV | AB | DIV AB |
MOV | data addr (direct), data addr (direct) | MOV P1, P0 |
MOV | data addr (direct),@R0 | MOV P0, @R0 |
MOV | data addr (direct),@R1 | MOV P0, @R1 |
MOV | data addr (direct),R0 | MOV P2, R0 |
MOV | data addr (direct),R1 | MOV P2, R1 |
MOV | data addr (direct),R2 | MOV P2, R2 |
MOV | data addr (direct),R3 | MOV P2, R3 |
MOV | data addr (direct),R4 | MOV P2, R4 |
MOV | data addr (direct),R5 | MOV P2, R5 |
MOV | data addr (direct),R6 | MOV P2, R6 |
MOV | data addr (direct),R7 | MOV P2, R7 |
MOV | DPTR, #data16 (immediate) | MOV DPTR, # 1234H |
ACALL | code addr (addr11) | ACALL SUBRTN |
MOV | bit addr,C | MOV 22h, C |
MOVC | A,@A+DPTR | MOVC A, @A+DPTR |
SUBB | A,#data (immediate) | SUBB A, #01h |
SUBB | A,data addr (direct) | SUBB A, 44h |
SUBB | A,@R0 | SUBB A, @R0 |
SUBB | A,@R1 | SUBB A, @R1 |
SUBB | A,R0 | SUBB A, R0 |
SUBB | A,R1 | SUBB A, R1 |
SUBB | A,R2 | SUBB A, R2 |
SUBB | A,R3 | SUBB A, R3 |
SUBB | A,R4 | SUBB A, R4 |
SUBB | A,R5 | SUBB A, R5 |
SUBB | A,R6 | SUBB A, R6 |
SUBB | A,R7 | SUBB A, R7 |
ORL | C,/bit addr | ORL C, /22h |
AJMP | code addr (addr11) | AJMP JMPADR |
MOV | C,bit addr | MOV C, 22h |
INC | DPTR | INC DPTR |
MUL | AB | MUL AB |
reserved | ||
MOV | @R0,data addr (direct) | MOV @R0, P2 |
MOV | @R1,data addr (direct) | MOV @R1, P2 |
MOV | R0,data addr (direct) | MOV R0, P1 |
MOV | R1,data addr (direct) | MOV R1, P1 |
MOV | R2,data addr (direct) | MOV R2, P1 |
MOV | R3,data addr (direct) | MOV R3, P1 |
MOV | R4,data addr (direct) | MOV R4, P1 |
MOV | R5,data addr (direct) | MOV R5, P1 |
MOV | R6,data addr (direct) | MOV R6, P1 |
MOV | R7,data addr (direct) | MOV R7, P1 |
ANL | C,/bit addr | ANL C, /22h |
ACALL | code addr (addr11) | ACALL SUBRTN |
CPL | bit addr | CPL P1.1 |
CPL | C | CPL C |
CJNE | A,#data (immediate), code addr (rel) | CJNE A, #01H, LABEL |
CJNE | A,data addr (direct), code addr (rel) | CJNE A, 60h, LABEL |
CJNE | @R0,#data (immediate), code addr (rel) | CJNE @R0, #24H, LABEL |
CJNE | @R1,#data (immediate), code addr (rel) | CJNE @R1, #24H, LABEL |
CJNE | R0,#data (immediate), code addr (rel) | CJNE R0, #12H, LABEL |
CJNE | R1,#data (immediate), code addr (rel) | CJNE R1, #12H, LABEL |
CJNE | R2,#data (immediate), code addr (rel) | CJNE R2, #12H, LABEL |
CJNE | R3,#data (immediate), code addr (rel) | CJNE R3, #12H, LABEL |
CJNE | R4,#data (immediate), code addr (rel) | CJNE R4, #12H, LABEL |
CJNE | R5,#data (immediate), code addr (rel) | CJNE R5, #12H, LABEL |
CJNE | R6,#data (immediate), code addr (rel) | CJNE R6, #12H, LABEL |
CJNE | R7,#data (immediate), code addr (rel) | CJNE R7, #12H, LABEL |
PUSH | data addr (direct) | PUSH DPL |
AJMP | code addr (addr11) | AJMP JMPADR |
CLR | bit addr | CLR P1.2 |
CLR | C | CLR C |
SWAP | A | SWAP A |
XCH | A,data addr (direct) | XCH A, 45h |
XCH | A,@R0 | XCH A, @R0 |
XCH | A,@R1 | XCH A, @R1 |
XCH | A,R0 | XCH A, R0 |
XCH | A,R1 | XCH A, R1 |
XCH | A,R2 | XCH A, R2 |
XCH | A,R3 | XCH A, R3 |
XCH | A,R4 | XCH A, R4 |
XCH | A,R5 | XCH A, R5 |
XCH | A,R6 | XCH A, R6 |
XCH | A,R7 | XCH A, R7 |
POP | data addr (direct) | POP 34h |
ACALL | code addr (addr11) | ACALL SUBRTN |
SETB | bit addr | SETB 63h |
SETB | C | SETB C |
DA | A | DA A |
DJNZ | data addr (direct), code addr (rel) | DJNZ 40h, LABEL |
XCHD | A,@R0 | XCHD A,@R0 |
XCHD | A,@R1 | XCHD A,@R1 |
DJNZ | R0,code addr (rel) | DJNZ R0, LABEL |
DJNZ | R1,code addr (rel) | DJNZ R1, LABEL |
DJNZ | R2,code addr (rel) | DJNZ R2, LABEL |
DJNZ | R3,code addr (rel) | DJNZ R3, LABEL |
DJNZ | R4,code addr (rel) | DJNZ R4, LABEL |
DJNZ | R5,code addr (rel) | DJNZ R5, LABEL |
DJNZ | R6,code addr (rel) | DJNZ R6, LABEL |
DJNZ | R7,code addr (rel) | DJNZ R7, LABEL |
MOVX | A,@DPTR | MOVX A, @DPTR |
AJMP | code addr (addr11) | AJMP JMPADR |
MOVX | A,@R0 | MOVX A, @R0 |
MOVX | A,@R1 | MOVX A, @R1 |
CLR | A | CLR A |
MOV | A,data addr (direct) | MOV A, P0 |
MOV | A,@R0 | MOV A, @R0 |
MOV | A,@R1 | MOV A, @R1 |
MOV | A,R0 | MOV A, R0 |
MOV | A,R1 | MOV A, R1 |
MOV | A,R2 | MOV A, R2 |
MOV | A,R3 | MOV A, R3 |
MOV | A,R4 | MOV A, R4 |
MOV | A,R5 | MOV A, R5 |
MOV | A,R6 | MOV A, R6 |
MOV | A,R7 | MOV A, R7 |
MOVX | @DPTR,A | MOVX @DPTR, A |
ACALL | code addr (addr11) | ACALL SUBRTN |
MOVX | @R0,A | MOVX @R0, A |
MOVX | @R1,A | MOVX @R1, A |
CPL | A | CPL A |
MOV | data addr (direct),A | MOV P0, A |
MOV | @R0,A | MOV @R0, A |
MOV | @R1,A | MOV @R1, A |
MOV | R0,A | MOV R0, A |
MOV | R1,A | MOV R1, A |
MOV | R2,A | MOV R2, A |
MOV | R3,A | MOV R3, A |
MOV | R4,A | MOV R4, A |
MOV | R5,A | MOV R5, A |
MOV | R6,A | MOV R6, A |
MOV | R7,A | MOV 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 Instruction Opcode | 8051 Instructions that Affect Flag Settings
List of topics: 8051
No comments:
Post a Comment