SlideShare a Scribd company logo
1 of 9
Download to read offline
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 1
Instruction Set of 8085 microprocessor
a) Data Transfer Group
b) Arithmetic Group
c) Logical Group
d) Branching/Loop Group
e) Stack and Machine Control Group
Notation used in Instruction and opcode
Notations Meaning
M Memory location pointed by HL register pair
R 8-bit register
RP 16-bit register pair
RS Source register
RD Destination register
Addr 16-bit address
X 8-bit data
b) Arithmetic Operation Group
1. ADD R 2. ADD M 3. ADC R 4. ADC M
5. ADI data 6. ACI data 7. DAD RP 8. SUB R
9. SUB M 10. SBB R 11. SBB M 12. SUI data
13. SBI data 14. DAA 15. INR R 16. INR M
17. DCR R 18. DCR M 19. INX RP 20. DCX RP
1. ADD R
Description - Add content of register R to accumulator A and store the result in
accumulator A.
Operation - A + R ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of addition.
Example - ADD C
Before Execution After Execution
C = 45H C = 45H
A = 35H A = 7A H
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 2
2. ADD M
Description - Add content of memory location M to accumulator A and store
the result in accumulator A.
Operation - A + M ----> A OR A + (HL) ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of addition.
Example - ADD M
Before Execution After Execution
M = (HL) = (2030) = 30H M = (HL) = (2030) = 30H
A = 35H A = 65 H
3. ADC R
Description - Add content of register R and carry flag content to accumulator A
and store the result in accumulator A.
Operation - A + R + CY ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of addition.
Example - ADC B
Before Execution After Execution
B = 23H B = 23H
A = 35H A = 59 H
CY = 1 = Set CY = 0 = Reset
4. ADC M
Description - Add content of memory location M and carry flag content to
accumulator A and store the result in accumulator A.
Operation - A + M + CY ----> A OR A + (HL) + CY ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of addition.
Example - ADC M
Before Execution After Execution
M = (HL) = (1000) = 24H M = (HL) = (1000) = 24H
A = 32H A = 57 H
CY = 1 = Set CY = 0 = Reset
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 3
5. ADI data
Description - Add immediate data to accumulator A and store the result in
accumulator A.
Operation - A + data ----> A
No. of Bytes- 2
Flags - All flags are modified to reflect the result of addition.
Example - ADI 73 H
Before Execution After Execution
data = 73H data = 73H
A = 35H A = A8 H
6. ACI data
Description - Add immediate data and carry flag content to accumulator A and
store the result in accumulator A.
Operation - A + data + CY ----> A
No. of Bytes- 2
Flags - All flags are modified to reflect the result of addition.
Example - ACI 10H
Before Execution After Execution
data = 10H data = 10H
A = 35H A = 46 H
CY = 1 = Set CY = 0 = Reset
7. DAD RP
Description - Add content of specified register pair RP to HL pair and store the
result in HL pair.
Operation - HL + RP ----> HL
No. of Bytes- 1
Flags - Only carry flags is modified to reflect the result of addition.
Example - DAD B
Before Execution After Execution
BC = 1245H BC = 1245H
HL = 1035H HL = 227A H
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 4
8. SUB R
Description - Subtract content of register R from accumulator A and store the
result in accumulator A.
Operation - A - R ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of subtraction.
If CY = set, result is negative and is in 2’s complement form.
If CY = reset, result is positive and is in normal form.
Example - SUB C
Before Execution After Execution
(i) C = 35H C = 35H
A = 45H A = 10 H
A = 45 H 0100 0101
C = 35 H 0011 0101
2’s Complement of C ----> 1100 1011
A = 45 H 0100 0101
2’s Complement of C ----> + 1100 1011
1 0001 0000
Carry is generated so CY = set, microprocessor complement this carry so CY =
reset, which represent that the result is positive and is in normal form (0001
0000 = 10 H).
(ii) C = 45H C = 45H
A = 35H A = F0 H
A = 35 H 0011 0101
C = 45 H 0100 0101
2’s Complement of C ----> 1011 1011
A = 35 H 0011 0101
2’s Complement of C ----> + 1011 1011
1111 0000
No carry generated so CY = reset, microprocessor complement this carry so CY
= set, which represent that the result is negative and is in 2’s complement
form (1111 0000).
10H
F0H
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 5
9. SUB M
Description - Subtract content of memory location M from accumulator A and
store the result in accumulator A.
Operation - A - M ----> A OR A - (HL) ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of subtraction.
If CY = set, result is negative and is in 2’s complement form.
If CY = reset, result is positive and is in normal form.
Example - SUB M
Before Execution After Execution
M = (HL) = (2030) = 30H M = (HL) = (2030) = 30H
A = 35H A = 05 H
Note: Subtraction method is same as SUB R.
10. SBB R
Description - Subtract content of register R and borrow flag content from
accumulator A and store the result in accumulator A.
Operation - A - R – Borrow Flag ----> A OR A - R – CY ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of subtraction.
If CY = set, result is negative and is in 2’s complement form.
If CY = reset, result is positive and is in normal form.
Example - SBB B
Before Execution After Execution
B = 23H B = 23H
A = 35H A =11 H
CY = 1 = Set CY = 0 = Reset
Note: Subtraction method is same as SUB R.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 6
11. SBB M
Description - Subtract content of memory location M and borrow flag content
from accumulator A and store the result in accumulator A.
Operation - A - M – Borrow Flag ----> A OR A - (HL) - CY ----> A
No. of Bytes- 1
Flags - All flags are modified to reflect the result of subtraction.
If CY = set, result is negative and is in 2’s complement form.
If CY = reset, result is positive and is in normal form.
Example - SBB M
Before Execution After Execution
M = (HL) = (1000) = 24H M = (HL) = (1000) = 24H
A = 32H A = 07 H
CY = 1 = Set CY = 0 = Reset
Note: Subtraction method is same as SUB R.
12. SUI data
Description - Subtract immediate data from accumulator A and store the result
in accumulator A.
Operation - A - data ----> A
No. of Bytes- 2
Flags - All flags are modified to reflect the result of subtraction.
If CY = set, result is negative and is in 2’s complement form.
If CY = reset, result is positive and is in normal form.
Example - ACI 10H
Before Execution After Execution
data = 10H data = 10H
A = 35H A = 25 H
Note: Subtraction method is same as SUB R.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 7
13. SBI data
Description - Subtract immediate data and borrow flag content from
accumulator A and store the result in accumulator A.
Operation - A – data – Borrow Flag ----> A OR A – data – CY ----> A
No. of Bytes- 2
Flags - All flags are modified to reflect the result of subtraction.
If CY = set, result is negative and is in 2’s complement form.
If CY = reset, result is positive and is in normal form.
Example - ACI 10H
Before Execution After Execution
data = 10H data = 10H
A = 35H A = 24 H
CY = 1 = Set CY = 0 = Reset
Note: Subtraction method is same as SUB R.
14. DAA (Decimal Adjust Accumulator)
Description - The contents of the accumulator A are changed from a binary
value to its equivalent two, 4-bit BCD number. This instruction is
used just after addition instruction.
Operation - A reg. in Binary ----> A reg. in BCD
No. of Bytes- 1
Flags - All flags are modified to reflect the result of addition. This is the
only instruction that uses auxiliary carry flag to perform the
operation of binary to BCD conversion.
Example - MVI A, 24H
ADI, 48H
DAA
Before Execution After Execution
data = 48H data = 48H
A = 24H A = 6C H (without DAA)
A = 72 H (with DAA)
A = 24H 0010 0100
data = 48H + 0100 1000
0110 1100 ----> 6C H
C is an invalid number in BCD so add 6H (0110) to make it valid.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 8
6C----> 0110 1100
+ 0110
0111 0010 ------> 72 H
Note: - DAA instruction checks the following:
(i) Is low order 4 bits D0-D3 greater than 9 or is AC flag is set. If any of the
above condition is satisfied then add 6 (0110) to low order 4 bits.
(ii) Is high order 4 bits D4-D7 greater than 9 or is CY flag is set. If any of the
above condition is satisfied then add 6 (0110) to high order 4 bits.
15. INR R
Description - Increment content of register R by one.
Operation - R + 1 ----> R
No. of Bytes- 1
Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to
reflect the result of operation.
Example - INR E
Before Execution After Execution
E = 45H E = 46H
16. INR M
Description - Increment content of memory location M by one.
Operation - M + 1 ----> M OR (HL) + 1 -----> (HL)
No. of Bytes- 1
Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to
reflect the result of operation.
Example - INR M
Before Execution After Execution
M = (HL) = (2000) = 45H M = (HL) = (2000) = 46H
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 9
17. DCR R
Description - Decrement content of register R by one.
Operation - R - 1 ----> R
No. of Bytes- 1
Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to
reflect the result of operation.
Example - DCR E
Before Execution After Execution
E = 45H E = 44H
18. DCR M
Description - Decrement content of memory location M by one.
Operation - M - 1 ----> M OR (HL) - 1 -----> (HL)
No. of Bytes- 1
Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to
reflect the result of operation.
Example - DCR M
Before Execution After Execution
M = (HL) = (2000) = 45H M = (HL) = (2000) = 44H
19. INX RP
Description - Increment content of register pair RP by one.
Operation - RP + 1 ----> RP
No. of Bytes- 1
Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to
reflect the result of operation.
Example - INX H
Before Execution After Execution
HL = 1245H HL = 1246H
20. DCX RP
Description - Decrement content of register pair RP by one.
Operation - RP - 1 ----> RP
No. of Bytes- 1
Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to
reflect the result of operation.
Example - DCX H
Before Execution After Execution
HL = 1245H HL = 1244H

More Related Content

What's hot

Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction FormatDhrumil Panchal
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORRamaPrabha24
 
8051 Programming Instruction Set
 8051 Programming Instruction Set 8051 Programming Instruction Set
8051 Programming Instruction SetShreyans Pathak
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 completeShubham Singh
 
Lecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential LogicLecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential LogicJames Evangelos
 
Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computerKamal Acharya
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085saleForce
 
Computer architecture register transfer languages rtl
Computer architecture register transfer languages rtlComputer architecture register transfer languages rtl
Computer architecture register transfer languages rtlMazin Alwaaly
 

What's hot (20)

Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
 
D and T Flip Flop
D and T Flip FlopD and T Flip Flop
D and T Flip Flop
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
 
8051 Programming Instruction Set
 8051 Programming Instruction Set 8051 Programming Instruction Set
8051 Programming Instruction Set
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 
Lecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential LogicLecture 5 Synchronous Sequential Logic
Lecture 5 Synchronous Sequential Logic
 
Presentation On Flip-Flop
Presentation On Flip-FlopPresentation On Flip-Flop
Presentation On Flip-Flop
 
Microoperations
MicrooperationsMicrooperations
Microoperations
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computer
 
Arithmetic and logical instructions
Arithmetic and logical instructionsArithmetic and logical instructions
Arithmetic and logical instructions
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 
Computer architecture register transfer languages rtl
Computer architecture register transfer languages rtlComputer architecture register transfer languages rtl
Computer architecture register transfer languages rtl
 

Similar to 8085 arithmetic instructions

MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085Sumadeep Juvvalapalem
 
8085 instruction set.pptx
8085 instruction set.pptx8085 instruction set.pptx
8085 instruction set.pptxAchintKaur27
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSSwapnil Mishra
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Shubham Singh
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085varun sukheja
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsZeeshan Ahmed
 
Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Jay Patel
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction setJLoknathDora
 
5. 8085 instruction set ii
5. 8085 instruction set ii5. 8085 instruction set ii
5. 8085 instruction set iisandip das
 
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...ijcisjournal
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :PJathin Kanumuri
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2Jathin Kanumuri
 
Instruction 4.pptx
Instruction 4.pptxInstruction 4.pptx
Instruction 4.pptxHebaEng
 
Register transfer & microoperations moris mano ch 04
Register transfer & microoperations    moris mano ch 04Register transfer & microoperations    moris mano ch 04
Register transfer & microoperations moris mano ch 04thearticlenow
 
18CS44-MES-Module-2(Chapter 3).pptx
18CS44-MES-Module-2(Chapter 3).pptx18CS44-MES-Module-2(Chapter 3).pptx
18CS44-MES-Module-2(Chapter 3).pptxrakshitha481121
 

Similar to 8085 arithmetic instructions (20)

MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085
 
Microprocessor 11el01
Microprocessor 11el01Microprocessor 11el01
Microprocessor 11el01
 
8085 instruction set.pptx
8085 instruction set.pptx8085 instruction set.pptx
8085 instruction set.pptx
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of Instructions
 
Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
5. 8085 instruction set ii
5. 8085 instruction set ii5. 8085 instruction set ii
5. 8085 instruction set ii
 
Mpi
MpiMpi
Mpi
 
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
Implementation of Low-Complexity Redundant Multiplier Architecture for Finite...
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
 
Instruction 4.pptx
Instruction 4.pptxInstruction 4.pptx
Instruction 4.pptx
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Class4
Class4Class4
Class4
 
Register transfer & microoperations moris mano ch 04
Register transfer & microoperations    moris mano ch 04Register transfer & microoperations    moris mano ch 04
Register transfer & microoperations moris mano ch 04
 
18CS44-MES-Module-2(Chapter 3).pptx
18CS44-MES-Module-2(Chapter 3).pptx18CS44-MES-Module-2(Chapter 3).pptx
18CS44-MES-Module-2(Chapter 3).pptx
 

Recently uploaded

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 

Recently uploaded (20)

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 

8085 arithmetic instructions

  • 1. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 1 Instruction Set of 8085 microprocessor a) Data Transfer Group b) Arithmetic Group c) Logical Group d) Branching/Loop Group e) Stack and Machine Control Group Notation used in Instruction and opcode Notations Meaning M Memory location pointed by HL register pair R 8-bit register RP 16-bit register pair RS Source register RD Destination register Addr 16-bit address X 8-bit data b) Arithmetic Operation Group 1. ADD R 2. ADD M 3. ADC R 4. ADC M 5. ADI data 6. ACI data 7. DAD RP 8. SUB R 9. SUB M 10. SBB R 11. SBB M 12. SUI data 13. SBI data 14. DAA 15. INR R 16. INR M 17. DCR R 18. DCR M 19. INX RP 20. DCX RP 1. ADD R Description - Add content of register R to accumulator A and store the result in accumulator A. Operation - A + R ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of addition. Example - ADD C Before Execution After Execution C = 45H C = 45H A = 35H A = 7A H
  • 2. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 2 2. ADD M Description - Add content of memory location M to accumulator A and store the result in accumulator A. Operation - A + M ----> A OR A + (HL) ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of addition. Example - ADD M Before Execution After Execution M = (HL) = (2030) = 30H M = (HL) = (2030) = 30H A = 35H A = 65 H 3. ADC R Description - Add content of register R and carry flag content to accumulator A and store the result in accumulator A. Operation - A + R + CY ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of addition. Example - ADC B Before Execution After Execution B = 23H B = 23H A = 35H A = 59 H CY = 1 = Set CY = 0 = Reset 4. ADC M Description - Add content of memory location M and carry flag content to accumulator A and store the result in accumulator A. Operation - A + M + CY ----> A OR A + (HL) + CY ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of addition. Example - ADC M Before Execution After Execution M = (HL) = (1000) = 24H M = (HL) = (1000) = 24H A = 32H A = 57 H CY = 1 = Set CY = 0 = Reset
  • 3. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 3 5. ADI data Description - Add immediate data to accumulator A and store the result in accumulator A. Operation - A + data ----> A No. of Bytes- 2 Flags - All flags are modified to reflect the result of addition. Example - ADI 73 H Before Execution After Execution data = 73H data = 73H A = 35H A = A8 H 6. ACI data Description - Add immediate data and carry flag content to accumulator A and store the result in accumulator A. Operation - A + data + CY ----> A No. of Bytes- 2 Flags - All flags are modified to reflect the result of addition. Example - ACI 10H Before Execution After Execution data = 10H data = 10H A = 35H A = 46 H CY = 1 = Set CY = 0 = Reset 7. DAD RP Description - Add content of specified register pair RP to HL pair and store the result in HL pair. Operation - HL + RP ----> HL No. of Bytes- 1 Flags - Only carry flags is modified to reflect the result of addition. Example - DAD B Before Execution After Execution BC = 1245H BC = 1245H HL = 1035H HL = 227A H
  • 4. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 4 8. SUB R Description - Subtract content of register R from accumulator A and store the result in accumulator A. Operation - A - R ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of subtraction. If CY = set, result is negative and is in 2’s complement form. If CY = reset, result is positive and is in normal form. Example - SUB C Before Execution After Execution (i) C = 35H C = 35H A = 45H A = 10 H A = 45 H 0100 0101 C = 35 H 0011 0101 2’s Complement of C ----> 1100 1011 A = 45 H 0100 0101 2’s Complement of C ----> + 1100 1011 1 0001 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset, which represent that the result is positive and is in normal form (0001 0000 = 10 H). (ii) C = 45H C = 45H A = 35H A = F0 H A = 35 H 0011 0101 C = 45 H 0100 0101 2’s Complement of C ----> 1011 1011 A = 35 H 0011 0101 2’s Complement of C ----> + 1011 1011 1111 0000 No carry generated so CY = reset, microprocessor complement this carry so CY = set, which represent that the result is negative and is in 2’s complement form (1111 0000). 10H F0H
  • 5. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 5 9. SUB M Description - Subtract content of memory location M from accumulator A and store the result in accumulator A. Operation - A - M ----> A OR A - (HL) ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of subtraction. If CY = set, result is negative and is in 2’s complement form. If CY = reset, result is positive and is in normal form. Example - SUB M Before Execution After Execution M = (HL) = (2030) = 30H M = (HL) = (2030) = 30H A = 35H A = 05 H Note: Subtraction method is same as SUB R. 10. SBB R Description - Subtract content of register R and borrow flag content from accumulator A and store the result in accumulator A. Operation - A - R – Borrow Flag ----> A OR A - R – CY ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of subtraction. If CY = set, result is negative and is in 2’s complement form. If CY = reset, result is positive and is in normal form. Example - SBB B Before Execution After Execution B = 23H B = 23H A = 35H A =11 H CY = 1 = Set CY = 0 = Reset Note: Subtraction method is same as SUB R.
  • 6. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 6 11. SBB M Description - Subtract content of memory location M and borrow flag content from accumulator A and store the result in accumulator A. Operation - A - M – Borrow Flag ----> A OR A - (HL) - CY ----> A No. of Bytes- 1 Flags - All flags are modified to reflect the result of subtraction. If CY = set, result is negative and is in 2’s complement form. If CY = reset, result is positive and is in normal form. Example - SBB M Before Execution After Execution M = (HL) = (1000) = 24H M = (HL) = (1000) = 24H A = 32H A = 07 H CY = 1 = Set CY = 0 = Reset Note: Subtraction method is same as SUB R. 12. SUI data Description - Subtract immediate data from accumulator A and store the result in accumulator A. Operation - A - data ----> A No. of Bytes- 2 Flags - All flags are modified to reflect the result of subtraction. If CY = set, result is negative and is in 2’s complement form. If CY = reset, result is positive and is in normal form. Example - ACI 10H Before Execution After Execution data = 10H data = 10H A = 35H A = 25 H Note: Subtraction method is same as SUB R.
  • 7. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 7 13. SBI data Description - Subtract immediate data and borrow flag content from accumulator A and store the result in accumulator A. Operation - A – data – Borrow Flag ----> A OR A – data – CY ----> A No. of Bytes- 2 Flags - All flags are modified to reflect the result of subtraction. If CY = set, result is negative and is in 2’s complement form. If CY = reset, result is positive and is in normal form. Example - ACI 10H Before Execution After Execution data = 10H data = 10H A = 35H A = 24 H CY = 1 = Set CY = 0 = Reset Note: Subtraction method is same as SUB R. 14. DAA (Decimal Adjust Accumulator) Description - The contents of the accumulator A are changed from a binary value to its equivalent two, 4-bit BCD number. This instruction is used just after addition instruction. Operation - A reg. in Binary ----> A reg. in BCD No. of Bytes- 1 Flags - All flags are modified to reflect the result of addition. This is the only instruction that uses auxiliary carry flag to perform the operation of binary to BCD conversion. Example - MVI A, 24H ADI, 48H DAA Before Execution After Execution data = 48H data = 48H A = 24H A = 6C H (without DAA) A = 72 H (with DAA) A = 24H 0010 0100 data = 48H + 0100 1000 0110 1100 ----> 6C H C is an invalid number in BCD so add 6H (0110) to make it valid.
  • 8. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 8 6C----> 0110 1100 + 0110 0111 0010 ------> 72 H Note: - DAA instruction checks the following: (i) Is low order 4 bits D0-D3 greater than 9 or is AC flag is set. If any of the above condition is satisfied then add 6 (0110) to low order 4 bits. (ii) Is high order 4 bits D4-D7 greater than 9 or is CY flag is set. If any of the above condition is satisfied then add 6 (0110) to high order 4 bits. 15. INR R Description - Increment content of register R by one. Operation - R + 1 ----> R No. of Bytes- 1 Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to reflect the result of operation. Example - INR E Before Execution After Execution E = 45H E = 46H 16. INR M Description - Increment content of memory location M by one. Operation - M + 1 ----> M OR (HL) + 1 -----> (HL) No. of Bytes- 1 Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to reflect the result of operation. Example - INR M Before Execution After Execution M = (HL) = (2000) = 45H M = (HL) = (2000) = 46H
  • 9. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 9 17. DCR R Description - Decrement content of register R by one. Operation - R - 1 ----> R No. of Bytes- 1 Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to reflect the result of operation. Example - DCR E Before Execution After Execution E = 45H E = 44H 18. DCR M Description - Decrement content of memory location M by one. Operation - M - 1 ----> M OR (HL) - 1 -----> (HL) No. of Bytes- 1 Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to reflect the result of operation. Example - DCR M Before Execution After Execution M = (HL) = (2000) = 45H M = (HL) = (2000) = 44H 19. INX RP Description - Increment content of register pair RP by one. Operation - RP + 1 ----> RP No. of Bytes- 1 Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to reflect the result of operation. Example - INX H Before Execution After Execution HL = 1245H HL = 1246H 20. DCX RP Description - Decrement content of register pair RP by one. Operation - RP - 1 ----> RP No. of Bytes- 1 Flags - Except carry flag, all other flags (S, Z, AC, and P) are modified to reflect the result of operation. Example - DCX H Before Execution After Execution HL = 1245H HL = 1244H