Instruction set of 8051

In this note, we discuss the Instruction Set of 8051 Microcontroller. Poly Notes Hub shares a brief knowledge of it.

Introduction of Instruction set of 8051

The instruction set of 8051 is divided into 5 categories. They are as follows:

  • Arithmetic Instruction
  • Logical Instruction
  • Data Transfer Instruction
  • Boolean Variable Manipulation Instruction
  • Program and Machine Control Instruction
instruction set of 8051

We have listed all the instruction set of 8051 with examples with description. Each instruction set of 8051 are explained in the next sections one by one.

Different types of Instruction Set of 8051 with examples

Below we describes all the types of instruction set of 8051 with examples.

Arithmetic Instructions

MnemonicsDescription
ADD A, RnAdd register to Accumulator
ADD A, DirectAdd direct byte to Accumulator
ADD A, @RiAdd indirect RAM to Accumulator
ADD A, #dataAdd immediate data to Accumulator
ADDC A, RnAdd register to accumulator with carry flag
ADDC A, directAdd direct byte to A with the carry flag
ADDC A, @RiAdd indirect RAM to the Accumulator with carry flag
SUBB A, RnSubtract register from A with borrow
SUBB A, directSubtract direct byte from A with borrow
SUBB A, @RiSubtract indirect RAM from A with borrow
INC AIncrement Accumulator
INC RnIncrement Register
INC directIncrement direct byte
INC @RiIncrement indirect RAM
DEC ADecrement Accumulator
DEC RnDecrement Register
DEC directDecrement direct byte
DEC @RiDecrement indirect RAM
INC DPTRIncrement data pointer
MUL ABMultiply A and B
DIV ABDivided A by B
DA ADecimal adjust Accumulator

Logical Instructions

MnemonicsDescription
ANL A, RnAND register to Accumulator
ANL A, directAND direct byte to Accumulator
ANL A, #dataAND immediate data to Accumulator
ANL direct, AAND Accumulator to direct byte
ORL A, RnOR register to Accumulator
ORL A, directOR direct byte to Accumulator
ORL A, #dataOR immediate data to Accumulator
ORL direct, AOR Accumulator to direct byte
XRL A, RnXOR register to Accumulator
XRL A, directXOR direct byte to Accumulator
XRL A, #dataXOR immediate data to Accumulator
XRL direct, AXOR Accumulator to direct byte
CLR AClear Accumulator
CPL AComplement Accumulator
RL ARotate Accumulator Left
RLC ARotate Accumulator Left through carry
RR ARotate Accumulator Right
RRC ARotate Accumulator Right through carry
SWAP ASwap nibbles within the Accumulator

Data Transfer Instructions

MnemonicsDescription
MOV A, RnMove register to Accumulator
MOV A, directMove direct byte to Accumulator
MOV A, @RiMove indirect RAM to Accumulator
MOV A, #dataMove immediate data to Accumulator
MOV Rn, AMove Accumulator to Register
MOV Rn, directMove direct byte to Register
MOV Rn, #dataMove immediate data to Register
MOV direct, AMove Accumulator to direct byte
MOV direct, RnMove register to direct byte
MOV direct, directMove direct byte to direct byte
PUSH directPush direct byte onto stack
POP directPop direct byte from stack
XCH A, RnExchange register with Accumulator
XCH A, directExchange direct byte with Accumulator
XCH A, @RiExchange indirect RAM with Accumulator
XCHD A, @RiExchange low-order nibble indirect RAM with Accumulator

Boolean Variable Manipulation Instructions

MnemonicsDescription
CLR CClear carry flag
CLR bitClear direct bit
SETB CSet carry flag
SETB bitSet direct bit
CPL CComplement carry flag
CPL bitComplement direct bit
ANL C, bitAND direct bit to carry flag
ANL C, bitAND complement of direct bit to carry
ORL C, bitOR direct bit to carry flag
ORL C, bitOR complement of direct bit to carry
MOV C, bitMove direct bit to carry flag

Program and Machine Control Instructions

MnemonicsDescription
ACALL addr 11Absolute subroutine call
LCALL addr 16Long subroutine call
RETReturn from subroutine
RETIReturn from interrupt
AJMP addr 11Absolute jump
LJMP addr 16Long jump
SJMP relShort jump

Conclusion | Diploma Engineering Notes | Poly Notes Hub

Our Poly Notes Hub provides syllabus-wise notes for polytechnic or diploma engineering students of streams like Electrical Engineering, Electronics Engineering, Electrical and electronics Engineering, Electronics & Instrumentation Engineering, and Computer Science & Technology. Our website is updating day by day so keep in touch with us for new and syllabus-wise notes and topic which helps you all to do any task regarding diploma engineering.

Share To:

2 thoughts on “Instruction set of 8051

  1. quia qui laboriosam dolor voluptatibus eaque natus et nesciunt consectetur amet vero ut. ut corrupti ducimus voluptatem qui in dicta itaque et ducimus nihil similique est quia animi. velit eos voluptatum quia molestiae vel hic ut neque et esse rerum fugit ipsa dolorem. quis et occaecati nemo quia nihil qui. quas consectetur est voluptas libero nostrum qui fuga fuga aut atque minus quibusdam.

Leave a Reply

Your email address will not be published. Required fields are marked *