SlideShare a Scribd company logo
1 of 21
Arithmetic Logical Instructions
for
8051 Microcontroller
-A.Usha Rani,
-Lecturer, Department of Physics and Electronics,
-St.Ann’s College for Women
ARITHMETIC INSTRUCTIONS
These instructions perform arithmetic operations.
The arithmetic operations modify Carry, Overflow
and Auxiliary carry flags based on the result of the
operation
The status of the flags can be used a test conditions.
ADDITION
The mnemonic for addition is ADD.
ADD A, source //Add contents of A with operand
source and store result in A
All addressing modes can be used for this instruction.
The register A is always the destination as well as one of
the source operands.
ADD A, # data //Add contents of A with immediate data
and store result in A
ADD A, #10H // Add the value 10H to the contents of A
and store the result in A
ADD A,Rn //Add contents of A with contents of Rn
and store result in A
ADD A, R3 //Add contents of A with contents of
register R3 and store result in A
ADD A, direct //Add contents of A with contents of
address direct and store result in A
ADD A, 45H //Add contents of A with contents of
address 45 H and store result in A
ADD A, @Ri // Add contents of A with contents of
address in Ri
ADD A, @R0 // Add contents of A with contents of
address in R0
SUBTRACTION
The mnemonic is SUBB
SUBB A, Source //Subtract the operand source
from contents of A and store result in A
SUBB A, # data // Subtract immediate data and carry
from A and store result in A
SUBB A, #10H // Subtract immediate data 10H and
carry from A and store result in A
SUBB A,Rn //Subtract contents of Rn and carry
from A and store result in A
SUBB A, R3 //Subtract contents of R3 and
carry from A and store result in A
SUBB A, direct // Subtract contents of address direct
and carry from A and store result in A
SUBB A, 45H // Subtract contents of address 45H and
carry from A and store result in A
SUBB A, @Ri //Subtract contents and carry of address
in Ri from A and store result in A
SUBB A, R0 //Subtract contents and carry of address
in R0 from A and store result in A
MULTIPLICATION
Multiplication uses only the registers A and B as source
and destination.
MULAB //Multiply the contents of A with B
and put lower byte of result in A
and higher byte of result in B.
DIVISION
Division uses only the registers A and B as source and
destination.
 The number in A is divided by the number in B.
Quotient is placed in A and remainder is placed in B.
DIV AB // Divide the contents of A with
contents of B and result (quotient)in
A and remainder in B.
INCREMENT
Used to add 1 to a operand.
Supports all addressing modes.
No flags are effected.
Useful to repeat the operations i.e to increment
till the desired result is obtained.
INC destination // Add 1 to the destination
operand.
INC A //Increment the contents of A by 1
INC A //Increment the contents of A by 1
INC Rn // Increment the contents of Rn by 1
INC R3 // Increment the contents of R3 by 1
INC @Ri // Increment the contents of address
pointed by Ri by1
INC @R0 // Increment the contents of address
pointed by R0 by1
INC Direct //Increment the contents of direct
address by 1
INC 45H //Increment the contents of direct
address 45H by 1
INC DPTR //Increment the contents of DPTR by 1
INC DPTR //Increment the contents of DPTR by 1
DECREMENT
Used to subtract 1 from a operand.
Supports all addressing modes.
No flags are effected.
Useful to repeat the operations i.e to
increment till the desired result is obtained.
DEC destination //Subtract 1 from
destination operand
DEC A // Decrement the contents of A by 1
DEC A // Decrement the contents of A by 1
DEC Rn // Decrement the contents of Rn by 1
DEC R3 // Decrement the contents of R3 by 1
DEC @Ri // Decrement the contents of address
pointed by Ri by1
DEC @R0 // Decrement the contents of address
pointed by R0 by1
DEC Direct // Decrement the contents of direct
address by 1
DEC 45H // Decrement the contents of direct
address by 1
DEC DPTR //Decrement the contents of DPTR by 1
DEC DPTR //Decrement the contents of DPTR by 1
LOGICAL INSTRUCTIONS
8051 supports the following logical operations
AND
OR
EX_OR
 NOT
AND Operation
ANLA,#data //Bitwise AND operation of A with data
ANLA,Rn // Bitwise AND operation of A with Rn
ANLA,@Ri //Bitwise AND operation of A with data
pointed by Ri
ANLA,direct // Bitwise AND operation of A with data
in direct
ANL direct, #data // Bitwise AND operation of data in
direct with immediate data
ANL direct, A // Bitwise AND operation of data in
address direct with A
OR Operation
ORLA,#data // Bitwise OR operation of A with data
ORLA,Rn // Bitwise OR operation of A with Rn
ORLA,@Ri // Bitwise OR operation of A with data
pointed by Ri
ORLA,direct // Bitwise OR operation of A with data
in direct
ORL direct, #data // Bitwise OR operation of data in
direct with immediate data
ORL direct, A // Bitwise OR operation of data in
address direct with A
Ex-OR Operation
XRLA,#data // Bitwise X-OR operation of A with data
XRLA,Rn // Bitwise X-OR operation of A with Rn
XRLA,@Ri // Bitwise X-OR operation of A with data
pointed by Ri
XRLA,direct // Bitwise X-OR operation of A with data
in direct
XRL direct, #data // Bitwise X-OR operation of data in
direct with immediate data
XRL direct, A // Bitwise X-OR operation of data in
address direct with A
UNARY OPERATIONS
XRLA,#data //Bitwise X-OR operation of A with data
XRLA,Rn // Bitwise X-OR operation of A with Rn
XRLA,@Ri //Bitwise X-OR operation of A with data
pointed by Ri
XRLA,direct // Bitwise X-OR operation of A with
data in direct
XRL direct, #data //Bitwise X-OR operation of data
in direct with immediate data
XRL direct, A // Bitwise X-OR operation of data in
address direct with A

More Related Content

What's hot

Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 
Relay interfacing with 8051
Relay interfacing with 8051Relay interfacing with 8051
Relay interfacing with 8051Pratik Phadte
 
8251 usart programmable communication interface by aniket bhute
8251  usart  programmable communication interface by aniket bhute8251  usart  programmable communication interface by aniket bhute
8251 usart programmable communication interface by aniket bhuteAniket Bhute
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingAnkur Mahajan
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller pptRahul Kumar
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversionPraveen Kumar
 
Interrupt programming with 8051 microcontroller
Interrupt programming with 8051  microcontrollerInterrupt programming with 8051  microcontroller
Interrupt programming with 8051 microcontrollerAnkit Bhatnagar
 
555 Timer (detailed presentation)
555 Timer (detailed presentation)555 Timer (detailed presentation)
555 Timer (detailed presentation)Tanish Gupta
 
Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes UshaRani289
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 

What's hot (20)

SCR.pptx
SCR.pptxSCR.pptx
SCR.pptx
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
Relay interfacing with 8051
Relay interfacing with 8051Relay interfacing with 8051
Relay interfacing with 8051
 
Arduino dc motor
Arduino dc motor Arduino dc motor
Arduino dc motor
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
8251 usart programmable communication interface by aniket bhute
8251  usart  programmable communication interface by aniket bhute8251  usart  programmable communication interface by aniket bhute
8251 usart programmable communication interface by aniket bhute
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller ppt
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
 
Interrupt programming with 8051 microcontroller
Interrupt programming with 8051  microcontrollerInterrupt programming with 8051  microcontroller
Interrupt programming with 8051 microcontroller
 
555 Timer (detailed presentation)
555 Timer (detailed presentation)555 Timer (detailed presentation)
555 Timer (detailed presentation)
 
Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes
 
8051 serial communication-UART
8051 serial communication-UART8051 serial communication-UART
8051 serial communication-UART
 
Logic families
Logic familiesLogic families
Logic families
 
boolean 8051
boolean 8051boolean 8051
boolean 8051
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
latches
 latches latches
latches
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 

Similar to Arithmetic and logical instructions 8051 microcontroller

arithmetic instructions.pptx
arithmetic instructions.pptxarithmetic instructions.pptx
arithmetic instructions.pptxsavitasj
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers finalSARITHA REDDY
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051SARITHA REDDY
 
Microcontroller instruction set
Microcontroller instruction setMicrocontroller instruction set
Microcontroller instruction setShail Modi
 
The 8051 microcontroller
The 8051 microcontrollerThe 8051 microcontroller
The 8051 microcontrollerPallaviHailkar
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmananjain543
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051Dr. AISHWARYA N
 
microcontroller_instruction_set for ENGINEERING STUDENTS
microcontroller_instruction_set for  ENGINEERING STUDENTSmicrocontroller_instruction_set for  ENGINEERING STUDENTS
microcontroller_instruction_set for ENGINEERING STUDENTSssuser2b759d
 
432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdfShreeKrishnaTarai
 

Similar to Arithmetic and logical instructions 8051 microcontroller (17)

arithmetic instructions.pptx
arithmetic instructions.pptxarithmetic instructions.pptx
arithmetic instructions.pptx
 
8051 instruction_set.ppt
8051 instruction_set.ppt8051 instruction_set.ppt
8051 instruction_set.ppt
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers final
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Microcontroller instruction set
Microcontroller instruction setMicrocontroller instruction set
Microcontroller instruction set
 
8051assembly language
8051assembly language8051assembly language
8051assembly language
 
The 8051 microcontroller
The 8051 microcontrollerThe 8051 microcontroller
The 8051 microcontroller
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes ppt
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
addressingmodes8051.ppt
addressingmodes8051.pptaddressingmodes8051.ppt
addressingmodes8051.ppt
 
microcontroller_instruction_set for ENGINEERING STUDENTS
microcontroller_instruction_set for  ENGINEERING STUDENTSmicrocontroller_instruction_set for  ENGINEERING STUDENTS
microcontroller_instruction_set for ENGINEERING STUDENTS
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Unit vi
Unit viUnit vi
Unit vi
 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdf
 

Recently uploaded

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Recently uploaded (20)

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Arithmetic and logical instructions 8051 microcontroller

  • 1. Arithmetic Logical Instructions for 8051 Microcontroller -A.Usha Rani, -Lecturer, Department of Physics and Electronics, -St.Ann’s College for Women
  • 2. ARITHMETIC INSTRUCTIONS These instructions perform arithmetic operations. The arithmetic operations modify Carry, Overflow and Auxiliary carry flags based on the result of the operation The status of the flags can be used a test conditions.
  • 3. ADDITION The mnemonic for addition is ADD. ADD A, source //Add contents of A with operand source and store result in A All addressing modes can be used for this instruction. The register A is always the destination as well as one of the source operands.
  • 4. ADD A, # data //Add contents of A with immediate data and store result in A ADD A, #10H // Add the value 10H to the contents of A and store the result in A ADD A,Rn //Add contents of A with contents of Rn and store result in A ADD A, R3 //Add contents of A with contents of register R3 and store result in A
  • 5. ADD A, direct //Add contents of A with contents of address direct and store result in A ADD A, 45H //Add contents of A with contents of address 45 H and store result in A ADD A, @Ri // Add contents of A with contents of address in Ri ADD A, @R0 // Add contents of A with contents of address in R0
  • 6. SUBTRACTION The mnemonic is SUBB SUBB A, Source //Subtract the operand source from contents of A and store result in A
  • 7. SUBB A, # data // Subtract immediate data and carry from A and store result in A SUBB A, #10H // Subtract immediate data 10H and carry from A and store result in A SUBB A,Rn //Subtract contents of Rn and carry from A and store result in A SUBB A, R3 //Subtract contents of R3 and carry from A and store result in A
  • 8. SUBB A, direct // Subtract contents of address direct and carry from A and store result in A SUBB A, 45H // Subtract contents of address 45H and carry from A and store result in A SUBB A, @Ri //Subtract contents and carry of address in Ri from A and store result in A SUBB A, R0 //Subtract contents and carry of address in R0 from A and store result in A
  • 9. MULTIPLICATION Multiplication uses only the registers A and B as source and destination. MULAB //Multiply the contents of A with B and put lower byte of result in A and higher byte of result in B.
  • 10. DIVISION Division uses only the registers A and B as source and destination.  The number in A is divided by the number in B. Quotient is placed in A and remainder is placed in B. DIV AB // Divide the contents of A with contents of B and result (quotient)in A and remainder in B.
  • 11. INCREMENT Used to add 1 to a operand. Supports all addressing modes. No flags are effected. Useful to repeat the operations i.e to increment till the desired result is obtained. INC destination // Add 1 to the destination operand.
  • 12. INC A //Increment the contents of A by 1 INC A //Increment the contents of A by 1 INC Rn // Increment the contents of Rn by 1 INC R3 // Increment the contents of R3 by 1 INC @Ri // Increment the contents of address pointed by Ri by1 INC @R0 // Increment the contents of address pointed by R0 by1
  • 13. INC Direct //Increment the contents of direct address by 1 INC 45H //Increment the contents of direct address 45H by 1 INC DPTR //Increment the contents of DPTR by 1 INC DPTR //Increment the contents of DPTR by 1
  • 14. DECREMENT Used to subtract 1 from a operand. Supports all addressing modes. No flags are effected. Useful to repeat the operations i.e to increment till the desired result is obtained. DEC destination //Subtract 1 from destination operand
  • 15. DEC A // Decrement the contents of A by 1 DEC A // Decrement the contents of A by 1 DEC Rn // Decrement the contents of Rn by 1 DEC R3 // Decrement the contents of R3 by 1 DEC @Ri // Decrement the contents of address pointed by Ri by1 DEC @R0 // Decrement the contents of address pointed by R0 by1
  • 16. DEC Direct // Decrement the contents of direct address by 1 DEC 45H // Decrement the contents of direct address by 1 DEC DPTR //Decrement the contents of DPTR by 1 DEC DPTR //Decrement the contents of DPTR by 1
  • 17. LOGICAL INSTRUCTIONS 8051 supports the following logical operations AND OR EX_OR  NOT
  • 18. AND Operation ANLA,#data //Bitwise AND operation of A with data ANLA,Rn // Bitwise AND operation of A with Rn ANLA,@Ri //Bitwise AND operation of A with data pointed by Ri ANLA,direct // Bitwise AND operation of A with data in direct ANL direct, #data // Bitwise AND operation of data in direct with immediate data ANL direct, A // Bitwise AND operation of data in address direct with A
  • 19. OR Operation ORLA,#data // Bitwise OR operation of A with data ORLA,Rn // Bitwise OR operation of A with Rn ORLA,@Ri // Bitwise OR operation of A with data pointed by Ri ORLA,direct // Bitwise OR operation of A with data in direct ORL direct, #data // Bitwise OR operation of data in direct with immediate data ORL direct, A // Bitwise OR operation of data in address direct with A
  • 20. Ex-OR Operation XRLA,#data // Bitwise X-OR operation of A with data XRLA,Rn // Bitwise X-OR operation of A with Rn XRLA,@Ri // Bitwise X-OR operation of A with data pointed by Ri XRLA,direct // Bitwise X-OR operation of A with data in direct XRL direct, #data // Bitwise X-OR operation of data in direct with immediate data XRL direct, A // Bitwise X-OR operation of data in address direct with A
  • 21. UNARY OPERATIONS XRLA,#data //Bitwise X-OR operation of A with data XRLA,Rn // Bitwise X-OR operation of A with Rn XRLA,@Ri //Bitwise X-OR operation of A with data pointed by Ri XRLA,direct // Bitwise X-OR operation of A with data in direct XRL direct, #data //Bitwise X-OR operation of data in direct with immediate data XRL direct, A // Bitwise X-OR operation of data in address direct with A