8051 MICRO CONTROLLER INSTRUCTIONS


8051 Instruction Set
ARITHMETIC OPERATIONS
Mnemonic                        Description
ADD A,Rn                      Add register to Accumulator
 ADD A,direct               Add direct byte to Accumulator
 ADD A,@Ri                  Add indirect RAM to Accumulator
 ADD A,#data               Add immediate data to Accumulator
 ADDC A,Rn                  Add register to Accumulator with Carry
ADDC A,direct             Add direct byte to Accumulator with Carry
 ADDC A,@Ri               Add indirect RAM to Accumulator with Carry
 ADDC A,#data            Add immediate data to Acc with Carry
SUBB A,Rn                    Subtract Register from Acc with borrow
SUBB A,direct              Subtract direct byte from Acc with borrow
SUBB A,@Ri                 Subtract indirect RAM from ACC with borrow
 SUBB A,#data             Subtract immediate data from Acc with borrow
 INC A                           Increment Accumulator
 INC Rn                         Increment register
 INC direct                   Increment direct byte
 INC @Ri                      Increment direct RAM
 DEC A                         Decrement Accumulator
 DEC Rn                      Decrement Register
DEC direct                  Decrement direct byte
DEC @Ri                     Decrement indirect RAM
 INC DPTR                  Increment Data Pointer
MUL AB                     Multiply A & B
 DIV AB                      Divide A by B
DA A                           Decimal Adjust Accumulator
 LOGICAL OPERATIONS
Mnemonic                    Description
ANL A,Rn                     AND Register to Accumulator
ANL A,direct                AND direct byte to Accumulator
ANL A,@Ri                  AND indirect RAM to Accumulator
ANL A,#data                 AND immediate data toAccumulator
 ANL direct,A               AND Accumulator to direct byte
ANL direct,#data           AND immediate data to direct byte
ORL A,Rn                     OR register to Accumulator

ORL A,direct                   OR direct byte to Accumulator
 ORL A,@Ri                     OR indirect RAM to Accumulator
ORL A,#data                     OR immediate data to Accumulator
ORL direct,A                    OR Accumulator to direct byte
ORL direct,#data              OR immediate data to direct byte
 XRL A,Rn                       Exclusive-OR register to Accumulator
XRL A,direct                    Exclusive-OR direct byte to Accumulator
XRL A,@Ri                     Exclusive-OR indirect RAM to Accumulator
XRL A,#data                    Exclusive-OR immediate data to Accumulator
XRL direct,A                    Exclusive-OR Accumulator to direct byte
 XRL direct,#data            Exclusive-OR immediate data to direct byte
CLR A                             Clear Accumulator
CPL A                             Complement Accumulator
RL A                               Rotate Accumulator Left
 RLC A                            Rotate Accumulator Left through the Carry
 RR A                              Rotate Accumulator Right
RRC A                            Rotate Accumulator Right through the Carry
SWAP A                        Swap nibbles within the Accumulator
DATA TRANSFER INSTRUCTIONS
 Mnemonic                                    Description
MOV A,Rn                        Move register to Accumulator
MOV A,direct                   Move direct byte to Accumulator
MOV A,@Ri                     Move indirect RAM to Accumulator
 MOV A,#data                   Move immediate data to Accumulator
MOV Rn,A                         Move Accumulator to register
MOV Rn,direct                 Move direct byte to register
MOV Rn,#data                  Move immediate data to register
MOV direct,A                    Move Accumulator to direct byte
 MOV direct,Rn                 Move register to direct byte
MOV direct,direct              Move direct byte to direct
MOV direct,@Ri                Move indirect RAM to direct byte
MOV direct,#data              Move immediate data to direct byte
 MOV @Ri,A                     Move Accumulator to indirect RAM
MOV @Ri,direct                Move direct byte to indirect RAM
MOV @Ri,#data                 Move immediate data to indirect RAM
MOV DPTR,#data16           Load Data Pointer with a 16-bit constant
MOVC A,@A+DPTR          Move Code byte relative to DPTR to Acc
 MOVC A,@A+PC              Move Code byte relative to PC to Acc
MOVX A,@Ri                     Move External RAM (8- bit addr) to Acc
MOVX A,@DPTR               Move Exernal RAM (16- bit addr) to Acc
MOVX @Ri,A                      Move Acc to External RAM (8-bit addr)
MOVX @DPTR,A               Move Acc to External RAM (16-bit addr)
PUSH direct                          Push direct byte onto stack
POP direct                             Pop direct byte from stack
XCH A,Rn                     Exchange register with Accumulator
XCH A,direct                Exchange direct byte with Accumulator
 XCH A,@Ri                Exchange indirect RAM with Accumulator
 XCHD A,@Ri             Exchange low-order Digit indirect RAM with Acc
BOOLEAN VARIABLE MANIPULATION
Mnemonic                         Description
CLR C                                 Clear Carry  
CLR bit                              Clear direct bit
SETB C                              Set Carry
SETB bit                            Set direct bit
CPL C                                Complement Carry
CPL bit                              Complement direct bit
ANL C,bit                          AND direct bit to CARRY
ANL C,/bit                        AND complement of direct bit to Carry
 ORL C,bit                        OR direct bit to Carry
ORL C,/bit                       OR complement of direct bit to Carry
MOV C,bit                       Move direct bit to Carry
MOV bit,C                       Move Carry to direct bit
JC rel                                Jump if Carry is set
JNC rel                              Jump if Carry not set
JB bit,rel                           Jump if direct Bit is set
JNB bit,rel                        Jump if direct Bit is Not set
 JBC bit,rel                       Jump if direct Bit is set & clear bit
 PROGRAM BRANCHING
Mnemonic                                Description
ACALL addr11                          Absolute Subroutine Call
LCALL addr16                           Long Subroutine Call
 RET                                           Return from Subroutine
RETI                                           Return from interrupt
AJMP addr11                           Absolute Jump
 LJMP addr16                           Long Jump
SJMP rel                                    Short Jump (relative addr)
JMP @A+DPTR                        Jump indirect relative to the DPTR
JZ rel                                          Jump if Accumulator is Zero
JNZ rel                                       Jump if Accumulator is Not Zero
 CJNE A,direct,rel         Compare direct byte to Acc and Jump if Not Equal
CJNE A,#data,rel          Compare immediate to Acc and Jump if Not Equal
CJNE Rn,#data,rel       Compare immediate to reg and Jump if Not Equal

CJNE @Ri,#data,rel     Compare immediate to indirect and Jump if Not
                                                     Equal                                                                             
DJNZ Rn,rel                       Decrement register and Jump if Not Zero
DJNZ direct,rel                 Decrement direct byte and Jump if Not Zero
NOP                                     No Operation

Comments

Popular posts from this blog

UNIT-II MICROCONTROLLER NOTES

UNIT-III Addressing modes & Instruction set

8051 MC PIN DESCRIPTION