SlideShare a Scribd company logo
B.RAMA PRABHA
ASSISTANT PROFESSOR,
DEPARTMENT OF COMPUTER SCIENCE,
K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE,
CHENNAI-21
ARITHMETIC OPERATIONS
The 8085 microprocessor performs various arithmetic operations such as addition,
subtraction, increment and decrement operations. These arithmetic operations have the
following mnemonics.
 ADD – Add (Add the content of a register)
 ADI – Add Immediate (Add 8 bit data)
 SUB – Subtract (Subtract the content of a register)
 SUI – Subtract Immediate (subtract 8 bit data)
 INR – Increment (Increase the content of register by 1)
 DCR – Decrement(Decrease the content of register by 1)
2
Addition in 8085
 Any 8-bit value, or the contents of any register, or even the contents of a
memory location pointed by HL pair, can be summed up with the
contents of the accumulator register.
 The added value, i.e., the result is then stored in the accumulator register
itself.
 This function cannot be be used for two other registers together – the
addition has to be performed with the accumulator being one of the
addends.
 Thus, for example, the contents of, say, register C cannot be summed up
directly to the contents of register B.
3
ADD
 This is a 1 byte instruction.
 As discussed earlier, the contents of any register or memory location are added to the
contents of the accumulator register. The corresponding sum is then saved in the
accumulator. If the second addend is a memory, its address is specified by the H-L pair. All
flags linked with the addition are updated with the result of the addition performed.
Example : ADD B
4
The Opcode The Operand Description
ADD
R
Add register to the
accumulator
M
Add contents from the
location pointed by the HL
pair (M) to the contents of the
accumulator
ADC(ADD WITH CARRY)
 This is a 1 byte instruction.
 The only difference between the ADD and the ADC operations is that the ADC condition
considers the carry value as well. Thus, the Carry flag plays an important role and becomes
the third addend..
Example : ADC B
5
The Opcode The Operand Description
ADC
R
Add register to the
accumulator with carry
M
Add the content of the
location pointed by the value
in the HL pair (M) to the
accumulator with carry.
ADI(ADD IMMEDIATE WITH DATA)
 This is a 2 byte instruction.
 The contents of the accumulator register are added with immediate 8-bit data using the ADI
instruction. The sum is thus stored in the accumulator. All flags are correspondingly
modified...
Example : ADI 05H
6
The Opcode The Operand Description
ADI 8-bit immediate data
Add immediate value to the
accumulator
[A] <- [A] + data
DAD(ADD 16 BIT DATA)
 This is a 2 byte instruction.
 The 16-bit contents of any 8085 register pair are added to the contents of the H-L register
pair. The result is also stored in the H-L pair. The carry flag is also updated with the result of
the addition operation. No other flag bits are affected.
Example : DAD B
7
The Opcode The Operand Description
DAD Register pair
Add contents of register pair
to contents of H-L pair. The
result is stored in the H-L
pair.
Subtraction in 8085
 Any 8-bit value, or the contents of any register, or even the contents of a
memory location can be subtracted from the contents of the accumulator
register.
 The difference of this operation is stored in the accumulator.
 The subtraction is performed in 2’s complement form. (You can revisit
the concept of 2’s complement over here.)
 Also, if the result of the subtraction is negative, it is stored in its 2’s
complement form.
 Similar to the addition operation, no two 8-bit registers can be subtracted
directly, unless it is subtracted from the accumulator.
8
SUB(SUBTRACT TO THE REGISTER)
 This is a 1 byte instruction.
 The contents of any register or memory location are subtracted from the contents of the
accumulator register. The corresponding difference is then saved in the accumulator register.
If the operand is a memory, its address is specified by the H-L pair. All flags linked with the
subtraction operation are updated with the result of the operation performed.
Example : SUB B
9
The Opcode The Operand Description
SUB
R
Subtract register from the
accumulator
M
Subtract contents of the
location pointed by HL pair
(M) from the accumulator
SBB(SUBTRACT TO THE REGISTER WITH BORROW)
 This is a 1 byte instruction.
 The contents of any register or memory location AND the borrow value (the CY flag in this
case) are subtracted from the contents of the accumulator register. The corresponding
difference is saved in the accumulator register. If the operand is a memory, its address is
specified by the H-L pair.
Example : SBB B
10
The Opcode The Operand Description
SBB
R
Subtract register from the
accumulator with borrow
considered
M
Subtract the contents of the
location pointed by the HL
pair (M) from the accumulator
with borrow considered
SUI(SUBTRACT IMMEDIATE WITH DATA)
 This is a 2 byte instruction.
 The contents of the accumulator register are subtracted with immediate 8-bit data using the
SUI instruction. The answer is thus stored in the accumulator. All flags are correspondingly
modified to reflect the difference
Example : SUI 04H
11
The Opcode The Operand Description
SUI 8-bit immediate data
Subtract an immediate value
from the accumulator
SBI(SUBTRACT IMMEDIATE WITH BORROW)
 This is a 2 byte instruction.
 The contents of the accumulator register are subtracted with immediate 8-bit data AND the
borrow value (specified by the CY flag) using the SBI instruction. The answer is thus stored
in the accumulator. All flags are correspondingly modified to reflect the difference.
Example : SBI 04H
12
The Opcode The Operand Description
SBI 8-bit immediate data
Subtract an immediate value
from the accumulator with
Borrow considered
SBI(SUBTRACT IMMEDIATE WITH BORROW)
 This is a 2 byte instruction.
 The contents of the accumulator register are subtracted with immediate 8-bit data AND the
borrow value (specified by the CY flag) using the SBI instruction. The answer is thus stored
in the accumulator. All flags are correspondingly modified to reflect the difference.
Example : SBI 04H
13
The Opcode The Operand Description
SBI 8-bit immediate data
Subtract an immediate value
from the accumulator with
Borrow considered
Increment or Decrement in 8085
 Every register or memory location holds contents of size 8-bits. These
contents can be incremented and/or decremented by a value of 1.
 If we consider register pairs, then the 16-bit contents can also be
incremented or decremented by a value of 1.
14
INR(INCREMENT BY 1)
 This is a 1 byte instruction.
 The INR command is used to increment/increase the contents of a register or of the data at
the location pointed by HL pair(M) by one. The result is stored in the same location itself. In
the case of the operand being M, the value at the memory location given by the HL pair is
incremented by one. The value in the HL register pair does not change.
Example : INR B ,INR 1250M
15
The Opcode The Operand Description
INR
R
Increment Register contents
by one
M
Increment the content at the
memory location pointed by
the HL pair by one
INX(INCREMENT REGISTER PAIR BY 1)
 This is a 1 byte instruction.
 The INX instruction increments the contents of a register-pair by the value of one. The result
is stored in the same place itself.
Example : INX H
16
The Opcode The Operand Description
INX R
Increment contents of register
pair by one
DCR(DECREMENT BY 1)
 This is a 1 byte instruction.
 The DCR command is used to decrement/decrease the contents of a register or of a memory
location by the value of one. The result after this operation is stored in the same location
itself. If the operand happens to be a memory location, its address is then specified by the
contents of the H-L pair.
Example : DCR B , DCR 1250M
17
The Opcode The Operand Description
DCR
R
Decrement Register contents
by one
M
Decrement the content at the
memory location pointed by
the HL pair by one
DCX(DECREMENT REGISTER PAIR BY 1)
 This is a 1 byte instruction.
 The DCX instruction decrements the contents of the register-pair by the value of one. The
result is stored in the same place itself.
Example : DCX H
18
The Opcode The Operand Description
DCX R
Decrement register pair by
one
“
19

More Related Content

What's hot

Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessor
hepzijustin
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
Prof. Swapnil V. Kaware
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
ShivamSood22
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
Suchismita Paul
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
Velalar College of Engineering and Technology
 
Logical instruction of 8085
Logical instruction of 8085Logical instruction of 8085
Logical instruction of 8085
vishalgohel12195
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
prasadpawaskar
 
8155 PPI
8155 PPI8155 PPI
8155 PPI
ShivamSood22
 
8086
80868086
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.ppt
ISMT College
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
abhikalmegh
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessor
ATTO RATHORE
 
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSORLOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
RamaPrabha24
 
8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1
techbed
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
deval patel
 
8155 Basic Concepts
8155 Basic Concepts8155 Basic Concepts
8155 Basic Concepts
Srinath Kalikivayi
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
techbed
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf
Srikrishna Thota
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
ihsanjamil
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
Balakrishna Chowdary
 

What's hot (20)

Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessor
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
Logical instruction of 8085
Logical instruction of 8085Logical instruction of 8085
Logical instruction of 8085
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
8155 PPI
8155 PPI8155 PPI
8155 PPI
 
8086
80868086
8086
 
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.ppt
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessor
 
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSORLOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
 
8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
8155 Basic Concepts
8155 Basic Concepts8155 Basic Concepts
8155 Basic Concepts
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 

Similar to ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR

itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085
Shifali Sharma
 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdf
SaurabhPorwal14
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
saleForce
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
ssuserb448e2
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
venkateshkannat
 
Instructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIRInstructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIR
THEE CAVE
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
Shubham Singh
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
Swapnil Mishra
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
Akshay Sharma
 
8085 instructions details
8085 instructions details8085 instructions details
Microprocessor Basics CH-3
Microprocessor Basics CH-3Microprocessor Basics CH-3
Microprocessor Basics CH-3
Neelam Kapoor
 
Types of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorTypes of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessor
samarthpawar9890
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of Instructions
Zeeshan Ahmed
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
ssuser47c811
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
HimanshuPant41
 
Arithmetic and logical instructions
Arithmetic and logical instructionsArithmetic and logical instructions
Arithmetic and logical instructions
BIRLA VISHVAKARMA MAHAVIDYALAY
 
Mpi
MpiMpi
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
Basil John
 
Assembly language i
Assembly language iAssembly language i
Assembly language i
Vivek Kumar
 
Computer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notesComputer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notes
Lakshmi Sarvani Videla
 

Similar to ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR (20)

itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085
 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdf
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
Instructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIRInstructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIR
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 
8085 instructions details
8085 instructions details8085 instructions details
8085 instructions details
 
Microprocessor Basics CH-3
Microprocessor Basics CH-3Microprocessor Basics CH-3
Microprocessor Basics CH-3
 
Types of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorTypes of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessor
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of Instructions
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
Arithmetic and logical instructions
Arithmetic and logical instructionsArithmetic and logical instructions
Arithmetic and logical instructions
 
Mpi
MpiMpi
Mpi
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
 
Assembly language i
Assembly language iAssembly language i
Assembly language i
 
Computer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notesComputer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notes
 

More from RamaPrabha24

Dynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessorDynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessor
RamaPrabha24
 
programming techniques
programming techniquesprogramming techniques
programming techniques
RamaPrabha24
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
RamaPrabha24
 
instruction set and classificaion
instruction set and classificaioninstruction set and classificaion
instruction set and classificaion
RamaPrabha24
 
8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS
RamaPrabha24
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
RamaPrabha24
 
PINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSORPINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSOR
RamaPrabha24
 
memory classification
memory classificationmemory classification
memory classification
RamaPrabha24
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
RamaPrabha24
 
Basic terms used in microprocessor
Basic terms used in microprocessorBasic terms used in microprocessor
Basic terms used in microprocessor
RamaPrabha24
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
RamaPrabha24
 

More from RamaPrabha24 (11)

Dynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessorDynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessor
 
programming techniques
programming techniquesprogramming techniques
programming techniques
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
 
instruction set and classificaion
instruction set and classificaioninstruction set and classificaion
instruction set and classificaion
 
8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
 
PINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSORPINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSOR
 
memory classification
memory classificationmemory classification
memory classification
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Basic terms used in microprocessor
Basic terms used in microprocessorBasic terms used in microprocessor
Basic terms used in microprocessor
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 

Recently uploaded

Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
ZainabHashmi17
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
introduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdfintroduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdf
ravindarpurohit26
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 

Recently uploaded (20)

Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
introduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdfintroduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdf
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 

ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR

  • 1. B.RAMA PRABHA ASSISTANT PROFESSOR, DEPARTMENT OF COMPUTER SCIENCE, K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE, CHENNAI-21
  • 2. ARITHMETIC OPERATIONS The 8085 microprocessor performs various arithmetic operations such as addition, subtraction, increment and decrement operations. These arithmetic operations have the following mnemonics.  ADD – Add (Add the content of a register)  ADI – Add Immediate (Add 8 bit data)  SUB – Subtract (Subtract the content of a register)  SUI – Subtract Immediate (subtract 8 bit data)  INR – Increment (Increase the content of register by 1)  DCR – Decrement(Decrease the content of register by 1) 2
  • 3. Addition in 8085  Any 8-bit value, or the contents of any register, or even the contents of a memory location pointed by HL pair, can be summed up with the contents of the accumulator register.  The added value, i.e., the result is then stored in the accumulator register itself.  This function cannot be be used for two other registers together – the addition has to be performed with the accumulator being one of the addends.  Thus, for example, the contents of, say, register C cannot be summed up directly to the contents of register B. 3
  • 4. ADD  This is a 1 byte instruction.  As discussed earlier, the contents of any register or memory location are added to the contents of the accumulator register. The corresponding sum is then saved in the accumulator. If the second addend is a memory, its address is specified by the H-L pair. All flags linked with the addition are updated with the result of the addition performed. Example : ADD B 4 The Opcode The Operand Description ADD R Add register to the accumulator M Add contents from the location pointed by the HL pair (M) to the contents of the accumulator
  • 5. ADC(ADD WITH CARRY)  This is a 1 byte instruction.  The only difference between the ADD and the ADC operations is that the ADC condition considers the carry value as well. Thus, the Carry flag plays an important role and becomes the third addend.. Example : ADC B 5 The Opcode The Operand Description ADC R Add register to the accumulator with carry M Add the content of the location pointed by the value in the HL pair (M) to the accumulator with carry.
  • 6. ADI(ADD IMMEDIATE WITH DATA)  This is a 2 byte instruction.  The contents of the accumulator register are added with immediate 8-bit data using the ADI instruction. The sum is thus stored in the accumulator. All flags are correspondingly modified... Example : ADI 05H 6 The Opcode The Operand Description ADI 8-bit immediate data Add immediate value to the accumulator [A] <- [A] + data
  • 7. DAD(ADD 16 BIT DATA)  This is a 2 byte instruction.  The 16-bit contents of any 8085 register pair are added to the contents of the H-L register pair. The result is also stored in the H-L pair. The carry flag is also updated with the result of the addition operation. No other flag bits are affected. Example : DAD B 7 The Opcode The Operand Description DAD Register pair Add contents of register pair to contents of H-L pair. The result is stored in the H-L pair.
  • 8. Subtraction in 8085  Any 8-bit value, or the contents of any register, or even the contents of a memory location can be subtracted from the contents of the accumulator register.  The difference of this operation is stored in the accumulator.  The subtraction is performed in 2’s complement form. (You can revisit the concept of 2’s complement over here.)  Also, if the result of the subtraction is negative, it is stored in its 2’s complement form.  Similar to the addition operation, no two 8-bit registers can be subtracted directly, unless it is subtracted from the accumulator. 8
  • 9. SUB(SUBTRACT TO THE REGISTER)  This is a 1 byte instruction.  The contents of any register or memory location are subtracted from the contents of the accumulator register. The corresponding difference is then saved in the accumulator register. If the operand is a memory, its address is specified by the H-L pair. All flags linked with the subtraction operation are updated with the result of the operation performed. Example : SUB B 9 The Opcode The Operand Description SUB R Subtract register from the accumulator M Subtract contents of the location pointed by HL pair (M) from the accumulator
  • 10. SBB(SUBTRACT TO THE REGISTER WITH BORROW)  This is a 1 byte instruction.  The contents of any register or memory location AND the borrow value (the CY flag in this case) are subtracted from the contents of the accumulator register. The corresponding difference is saved in the accumulator register. If the operand is a memory, its address is specified by the H-L pair. Example : SBB B 10 The Opcode The Operand Description SBB R Subtract register from the accumulator with borrow considered M Subtract the contents of the location pointed by the HL pair (M) from the accumulator with borrow considered
  • 11. SUI(SUBTRACT IMMEDIATE WITH DATA)  This is a 2 byte instruction.  The contents of the accumulator register are subtracted with immediate 8-bit data using the SUI instruction. The answer is thus stored in the accumulator. All flags are correspondingly modified to reflect the difference Example : SUI 04H 11 The Opcode The Operand Description SUI 8-bit immediate data Subtract an immediate value from the accumulator
  • 12. SBI(SUBTRACT IMMEDIATE WITH BORROW)  This is a 2 byte instruction.  The contents of the accumulator register are subtracted with immediate 8-bit data AND the borrow value (specified by the CY flag) using the SBI instruction. The answer is thus stored in the accumulator. All flags are correspondingly modified to reflect the difference. Example : SBI 04H 12 The Opcode The Operand Description SBI 8-bit immediate data Subtract an immediate value from the accumulator with Borrow considered
  • 13. SBI(SUBTRACT IMMEDIATE WITH BORROW)  This is a 2 byte instruction.  The contents of the accumulator register are subtracted with immediate 8-bit data AND the borrow value (specified by the CY flag) using the SBI instruction. The answer is thus stored in the accumulator. All flags are correspondingly modified to reflect the difference. Example : SBI 04H 13 The Opcode The Operand Description SBI 8-bit immediate data Subtract an immediate value from the accumulator with Borrow considered
  • 14. Increment or Decrement in 8085  Every register or memory location holds contents of size 8-bits. These contents can be incremented and/or decremented by a value of 1.  If we consider register pairs, then the 16-bit contents can also be incremented or decremented by a value of 1. 14
  • 15. INR(INCREMENT BY 1)  This is a 1 byte instruction.  The INR command is used to increment/increase the contents of a register or of the data at the location pointed by HL pair(M) by one. The result is stored in the same location itself. In the case of the operand being M, the value at the memory location given by the HL pair is incremented by one. The value in the HL register pair does not change. Example : INR B ,INR 1250M 15 The Opcode The Operand Description INR R Increment Register contents by one M Increment the content at the memory location pointed by the HL pair by one
  • 16. INX(INCREMENT REGISTER PAIR BY 1)  This is a 1 byte instruction.  The INX instruction increments the contents of a register-pair by the value of one. The result is stored in the same place itself. Example : INX H 16 The Opcode The Operand Description INX R Increment contents of register pair by one
  • 17. DCR(DECREMENT BY 1)  This is a 1 byte instruction.  The DCR command is used to decrement/decrease the contents of a register or of a memory location by the value of one. The result after this operation is stored in the same location itself. If the operand happens to be a memory location, its address is then specified by the contents of the H-L pair. Example : DCR B , DCR 1250M 17 The Opcode The Operand Description DCR R Decrement Register contents by one M Decrement the content at the memory location pointed by the HL pair by one
  • 18. DCX(DECREMENT REGISTER PAIR BY 1)  This is a 1 byte instruction.  The DCX instruction decrements the contents of the register-pair by the value of one. The result is stored in the same place itself. Example : DCX H 18 The Opcode The Operand Description DCX R Decrement register pair by one