Download presentation
Presentation is loading. Please wait.
Published byYuliana Sudjarwadi Modified over 6 years ago
1
Instruction Groups The 8051 has 255 instructions.
The instructions are grouped into 5 groups: Arithmetic Logic Data Transfer Boolean Branching 20-Sep-18 Micro 8051
2
Arithmetic Instructions
ADD 8-bit addition between the accumulator (A) and a second operand. The result is always in the accumulator. The CY flag is set/reset appropriately. ADDC 8-bit addition between the accumulator, a second operand and the previous value of the CY flag. Useful for 16-bit addition in two steps. 20-Sep-18 Micro 8051
3
Arithmetic Instructions
DA Decimal adjust the accumulator. Format the accumulator into a proper 2 digit packed BCD number. Operates only on the accumulator. Works only after the ADD instruction. SUBB Subtract with Borrow. Subtract an operand and the previous value of the borrow (carry) flag from the accumulator. A A - <operand> - CY. The result is always saved in the accumulator. The CY flag is set/reset appropriately. 20-Sep-18 Micro 8051
4
Arithmetic Instructions
INC Increment the operand by one. The operand can be a register, a direct address, an indirect address, the data pointer. DEC Decrement the operand by one. The operand can be a register, a direct address, an indirect address. MUL AB / DIV AB Multiply A by B and place result in B:A. Divide A by B and place result in A (Quotient):B(Remainder). 20-Sep-18 Micro 8051
5
Arithmetic Instructions
ADD A,Rn Add register to accumulator ADD A,direct Add direct byte to accumulator ADD Add indirect RAM to accumulator ADD A,#data Add immediate data to accumulator ADDC A,Rn Add register to accumulator with carry flag 1 1 ADDC A,direct Add direct byte to A with carry flag ADDC Add indirect RAM to A with carry flag ADDC A, #data Add immediate data to A with carry flag 2 1 SUBB A,Rn Subtract register from A with borrow SUBB A,direct Subtract direct byte from A with borrow 2 1 SUBB Subtract indirect RAM from A with borrow 1 1 SUBB A,#data Subtract immediate data from A with borrow 2 1 20-Sep-18 Micro 8051
6
Arithmetic Instructions
INC A Increment accumulator INC Rn Increment register INC direct Increment direct byte Incrément indirect RAM INC DPTR Increment data pointer DEC A Decrement accumulator DEC Rn Decrement register DEC direct Decrement direct byte Decrement indirect RAM MUL AB Multiply A and B DIV AB Divide A by B DA A Decimal adjust accumulator 20-Sep-18 Micro 8051
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.