SlideShare a Scribd company logo
1 of 15
Download to read offline
PRINCIPLES OF 8085 MICROPROCESSOR
Dr.S.Barani
School of Electrical and Electronics Engineering
Sathyabama Institute of Science and Technology
Week 2 – Instruction sets
A certified Moodle Course on
ARITHMETIC INSTRUCTIONS
2
A certified Moodle Course on Principles of 8085 Microprocessor
ADDITION
ADD Add immediate to acc
ADC Add reg/M to acc with carry
ADI Add immediate to acc
ACI Add immediate to acc with carry
SUBTRACTION
SUB Subtract reg/M from acc
SBB Subtract reg/M and borroe from acc
SUI Subtract immediate data from acc
SBI Subtract immediate data and borrow from acc
3
A certified Moodle Course on Principles of 8085 Microprocessor
INCREMENT / DECREMENT
INR increment reg
INX increment reg.pair
DCR decrement reg
DCX decremenr reg.pair
ADDITION OF 16 BIT
DAD add reg.pair with HL
4
A certified Moodle Course on Principles of 8085 Microprocessor
Addition of 8 and
16 bit
5
A certified Moodle Course on Principles of 8085 Microprocessor
ADD M
Register Contents Before execution
Register Contents After execution
Syntax ADD reg / M – 1 byte Add reg / M to acc
6
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(reg/M)
M 51
A 47
M 51
A 98
S Z XX AC XX P XX C
1 0 0 0 0
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
M = 0 1 0 1 0 0 0 1
A(A+M) = 1 0 0 1 1 0 0 0
ADI 51
Register Contents Before execution
Register Contents After execution
Syntax ADI 8 bit data – 2 byte Add immediate to acc
7
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(data)
data 51
A 47
M 51
A 98
S Z XX AC XX P XX C
1 0 0 0 0
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
data = 0 1 0 1 0 0 0 1
A(A+M) = 1 0 0 1 1 0 0 0
ADD M
Register Contents Before execution
Register Contents After execution
Syntax ADC reg / M – 1 byte Add reg/M and carry to acc
8
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(reg/M)
M 51
A 47
C 1
M 51
A 99
C 1
S Z XX AC XX P XX C
1 0 0 0 1
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
M = 0 1 0 1 0 0 0 1
C 1
A(A+M) = 1 0 0 1 1 0 0 1
ADI 51
Register Contents Before execution
Register Contents After execution
Syntax ADI 8 bit data – 2 byte Add immediate to acc
9
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(data)
data 51
A 47
M 51
A 99
S Z XX AC XX P XX C
1 0 0 0 1
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
data = 0 1 0 1 0 0 0 1
C 1
A(A+M) = 1 0 0 1 1 0 0 1
DAD D
Register Contents Before execution
If the result is greater than 16 bits then C bit is set. All
other flags remain unaltered.
Register Contents After execution
Syntax DAD reg.pair – 1 byte Add reg.pair to HL reg. pair
10
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
HL =
HL +
(reg.pair
)
H L
22 21
D E
02 20
2221 (HL)
0220 (DE)
2441 (HL- Ans)
H L
24 41
D E
02 20
TRY - OUT
TASK 1
Execute the
instruction DAD SP
and update the
contents of registers
and status of Flag
register.
Before execution
The content of HL -
6231
The content of SP –
9901
TASK 2
Execute the instruction
ADI F0 and update the
contents of registers
and status of Flag
register.
Before execution
The content of A - 40
TASK 3
Execute the instruction
ADC M and update the
contents of registers
and status of Flag
register.
Before execution
The content of A - 40
The content of M -30
11
A certified Moodle Course on Principles of 8085 Microprocessor
SOLUTION - TASK 1
Before execution
After execution
12
A certified Moodle Course on Principles of 8085 Microprocessor
H L
72 31
99 01
0B 32
H L
TASK 1
Execute the
instruction DAD SP
and update the
contents of registers
and status of Flag
register.
Before execution
The content of HL -
6231
The content of SP –
9901
SP
7231
9901
1 0B32
S Z XX AC XX P XX C
No Change 1
SOLUTION - TASK 2
Before execution
Carry =1 After execution
13
A certified Moodle Course on Principles of 8085 Microprocessor
A DATA
40 F0
30 F0
A DATA
TASK 2
Execute the
instruction ADI F0
and update the
contents of
registers and
status of Flag
register.
Before execution
The content of A -
40S Z XX AC XX P XX C
0 0 0 1 1
A 0 1 0 0 0 0 0 0
DATA 1 1 1 1 0 0 0 0
A 10 0 1 1 0 0 0 0
SOLUTION - TASK 3
Before execution
After execution
14
A certified Moodle Course on Principles of 8085 Microprocessor
A M
40 30
70
A
TASK 3
Execute the
instruction ADC M
and update the
contents of
registers and
status of Flag
register.
Before execution
The content of A -
40
The content of M -
30
A 0 1 0 0 0 0 0 0
M 0 0 1 1 0 0 0 0
A 0 1 1 1 0 0 0 0
S Z XX AC XX P XX C
0 0 0 0 0
A certified Moodle Course on Principles of 8085 Microprocessor

More Related Content

Similar to Week 2.4 Arithmetic Instructions

MDRM(Master Data Record Manager)
MDRM(Master Data Record Manager)MDRM(Master Data Record Manager)
MDRM(Master Data Record Manager)
Shadab akram Khan
 
Exporting from archival management software
Exporting from archival management softwareExporting from archival management software
Exporting from archival management software
Jane Stevenson
 
Ee6612 miroprocessor and microcontroller laboratory
Ee6612 miroprocessor and microcontroller laboratoryEe6612 miroprocessor and microcontroller laboratory
Ee6612 miroprocessor and microcontroller laboratory
recarunkumar
 
Micrcontroller iv sem lab manual
Micrcontroller iv sem lab manualMicrcontroller iv sem lab manual
Micrcontroller iv sem lab manual
RohiniHM2
 

Similar to Week 2.4 Arithmetic Instructions (20)

Latest results2016
Latest results2016Latest results2016
Latest results2016
 
plcs
plcsplcs
plcs
 
Training Pcs7 Simatic Documents Series.pptx
Training Pcs7 Simatic Documents Series.pptxTraining Pcs7 Simatic Documents Series.pptx
Training Pcs7 Simatic Documents Series.pptx
 
MDRM(Master Data Record Manager)
MDRM(Master Data Record Manager)MDRM(Master Data Record Manager)
MDRM(Master Data Record Manager)
 
Exporting from archival management software
Exporting from archival management softwareExporting from archival management software
Exporting from archival management software
 
Mpi
MpiMpi
Mpi
 
VTU-15ecschsyll cbcs
VTU-15ecschsyll cbcsVTU-15ecschsyll cbcs
VTU-15ecschsyll cbcs
 
MPMC LAB MANUAL EEE
MPMC LAB MANUAL EEEMPMC LAB MANUAL EEE
MPMC LAB MANUAL EEE
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Ee6612 miroprocessor and microcontroller laboratory
Ee6612 miroprocessor and microcontroller laboratoryEe6612 miroprocessor and microcontroller laboratory
Ee6612 miroprocessor and microcontroller laboratory
 
Final Year Review
Final Year ReviewFinal Year Review
Final Year Review
 
TrustNote Cryptographic Algorithms Overview
TrustNote Cryptographic Algorithms OverviewTrustNote Cryptographic Algorithms Overview
TrustNote Cryptographic Algorithms Overview
 
2016 EASA-module-1-mathematics
2016 EASA-module-1-mathematics2016 EASA-module-1-mathematics
2016 EASA-module-1-mathematics
 
03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en
 
Mid Year Review
Mid Year ReviewMid Year Review
Mid Year Review
 
Mp lab manual
Mp lab manualMp lab manual
Mp lab manual
 
Micrcontroller iv sem lab manual
Micrcontroller iv sem lab manualMicrcontroller iv sem lab manual
Micrcontroller iv sem lab manual
 
microprocessor_labbmet.pdf
microprocessor_labbmet.pdfmicroprocessor_labbmet.pdf
microprocessor_labbmet.pdf
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor lab
 
Labsheet1 ec303 student
Labsheet1 ec303 studentLabsheet1 ec303 student
Labsheet1 ec303 student
 

Recently uploaded

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Recently uploaded (20)

Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 

Week 2.4 Arithmetic Instructions

  • 1. PRINCIPLES OF 8085 MICROPROCESSOR Dr.S.Barani School of Electrical and Electronics Engineering Sathyabama Institute of Science and Technology Week 2 – Instruction sets A certified Moodle Course on
  • 2. ARITHMETIC INSTRUCTIONS 2 A certified Moodle Course on Principles of 8085 Microprocessor
  • 3. ADDITION ADD Add immediate to acc ADC Add reg/M to acc with carry ADI Add immediate to acc ACI Add immediate to acc with carry SUBTRACTION SUB Subtract reg/M from acc SBB Subtract reg/M and borroe from acc SUI Subtract immediate data from acc SBI Subtract immediate data and borrow from acc 3 A certified Moodle Course on Principles of 8085 Microprocessor
  • 4. INCREMENT / DECREMENT INR increment reg INX increment reg.pair DCR decrement reg DCX decremenr reg.pair ADDITION OF 16 BIT DAD add reg.pair with HL 4 A certified Moodle Course on Principles of 8085 Microprocessor
  • 5. Addition of 8 and 16 bit 5 A certified Moodle Course on Principles of 8085 Microprocessor
  • 6. ADD M Register Contents Before execution Register Contents After execution Syntax ADD reg / M – 1 byte Add reg / M to acc 6 A certified Moodle Course on Principles of 8085 Microprocessor Hint Acc = acc + (reg/M) M 51 A 47 M 51 A 98 S Z XX AC XX P XX C 1 0 0 0 0 S Z XX AC XX P XX C A = 0 1 0 0 0 1 1 1 M = 0 1 0 1 0 0 0 1 A(A+M) = 1 0 0 1 1 0 0 0
  • 7. ADI 51 Register Contents Before execution Register Contents After execution Syntax ADI 8 bit data – 2 byte Add immediate to acc 7 A certified Moodle Course on Principles of 8085 Microprocessor Hint Acc = acc + (data) data 51 A 47 M 51 A 98 S Z XX AC XX P XX C 1 0 0 0 0 S Z XX AC XX P XX C A = 0 1 0 0 0 1 1 1 data = 0 1 0 1 0 0 0 1 A(A+M) = 1 0 0 1 1 0 0 0
  • 8. ADD M Register Contents Before execution Register Contents After execution Syntax ADC reg / M – 1 byte Add reg/M and carry to acc 8 A certified Moodle Course on Principles of 8085 Microprocessor Hint Acc = acc + (reg/M) M 51 A 47 C 1 M 51 A 99 C 1 S Z XX AC XX P XX C 1 0 0 0 1 S Z XX AC XX P XX C A = 0 1 0 0 0 1 1 1 M = 0 1 0 1 0 0 0 1 C 1 A(A+M) = 1 0 0 1 1 0 0 1
  • 9. ADI 51 Register Contents Before execution Register Contents After execution Syntax ADI 8 bit data – 2 byte Add immediate to acc 9 A certified Moodle Course on Principles of 8085 Microprocessor Hint Acc = acc + (data) data 51 A 47 M 51 A 99 S Z XX AC XX P XX C 1 0 0 0 1 S Z XX AC XX P XX C A = 0 1 0 0 0 1 1 1 data = 0 1 0 1 0 0 0 1 C 1 A(A+M) = 1 0 0 1 1 0 0 1
  • 10. DAD D Register Contents Before execution If the result is greater than 16 bits then C bit is set. All other flags remain unaltered. Register Contents After execution Syntax DAD reg.pair – 1 byte Add reg.pair to HL reg. pair 10 A certified Moodle Course on Principles of 8085 Microprocessor Hint HL = HL + (reg.pair ) H L 22 21 D E 02 20 2221 (HL) 0220 (DE) 2441 (HL- Ans) H L 24 41 D E 02 20
  • 11. TRY - OUT TASK 1 Execute the instruction DAD SP and update the contents of registers and status of Flag register. Before execution The content of HL - 6231 The content of SP – 9901 TASK 2 Execute the instruction ADI F0 and update the contents of registers and status of Flag register. Before execution The content of A - 40 TASK 3 Execute the instruction ADC M and update the contents of registers and status of Flag register. Before execution The content of A - 40 The content of M -30 11 A certified Moodle Course on Principles of 8085 Microprocessor
  • 12. SOLUTION - TASK 1 Before execution After execution 12 A certified Moodle Course on Principles of 8085 Microprocessor H L 72 31 99 01 0B 32 H L TASK 1 Execute the instruction DAD SP and update the contents of registers and status of Flag register. Before execution The content of HL - 6231 The content of SP – 9901 SP 7231 9901 1 0B32 S Z XX AC XX P XX C No Change 1
  • 13. SOLUTION - TASK 2 Before execution Carry =1 After execution 13 A certified Moodle Course on Principles of 8085 Microprocessor A DATA 40 F0 30 F0 A DATA TASK 2 Execute the instruction ADI F0 and update the contents of registers and status of Flag register. Before execution The content of A - 40S Z XX AC XX P XX C 0 0 0 1 1 A 0 1 0 0 0 0 0 0 DATA 1 1 1 1 0 0 0 0 A 10 0 1 1 0 0 0 0
  • 14. SOLUTION - TASK 3 Before execution After execution 14 A certified Moodle Course on Principles of 8085 Microprocessor A M 40 30 70 A TASK 3 Execute the instruction ADC M and update the contents of registers and status of Flag register. Before execution The content of A - 40 The content of M - 30 A 0 1 0 0 0 0 0 0 M 0 0 1 1 0 0 0 0 A 0 1 1 1 0 0 0 0 S Z XX AC XX P XX C 0 0 0 0 0
  • 15. A certified Moodle Course on Principles of 8085 Microprocessor