SlideShare a Scribd company logo
2
Most read
5
Most read
9
Most read
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

PPTX
Interrupts of microprocessor 8085
PPTX
Stack in 8085 microprocessor
PPTX
Interrupts on 8086 microprocessor by vijay kumar.k
PPTX
Register Organisation of 8086 Microprocessor
PPT
pin-diagram-details-of-8086-microprocessor
PPTX
Instruction set of 8085 microprocessor
PDF
8085 stack &amp; machine control instruction
PPTX
INTERNAL STRUCTURE OF 8086 MICROPROCESSOR
Interrupts of microprocessor 8085
Stack in 8085 microprocessor
Interrupts on 8086 microprocessor by vijay kumar.k
Register Organisation of 8086 Microprocessor
pin-diagram-details-of-8086-microprocessor
Instruction set of 8085 microprocessor
8085 stack &amp; machine control instruction
INTERNAL STRUCTURE OF 8086 MICROPROCESSOR

What's hot (20)

PPTX
Stack in microprocessor 8085(presantation)
PPTX
8085 DATA TRANSFER INSTRUCTIONS
DOCX
8085 interfacing with memory chips
PPTX
Addressing Modes of 8085 Microprocessor
PPTX
3.programmable interrupt controller 8259
PPTX
Floating point arithmetic operations (1)
PPTX
Memory Segmentation of 8086
PPTX
4.programmable dma controller 8257
DOCX
8086 pin diagram description
PDF
8085 branching instruction
PPTX
Programmable peripheral interface 8255
PPTX
General register organization (computer organization)
PPTX
flag register of 8086
PPTX
Pin diagram 8085
PPT
Logical instruction of 8085
PPT
Microprocessor 80386
PPTX
Pentium processor
PPT
8085 microproceesor ppt
PDF
Difference b/w 8085 & 8086
PPT
8085-microprocessor
Stack in microprocessor 8085(presantation)
8085 DATA TRANSFER INSTRUCTIONS
8085 interfacing with memory chips
Addressing Modes of 8085 Microprocessor
3.programmable interrupt controller 8259
Floating point arithmetic operations (1)
Memory Segmentation of 8086
4.programmable dma controller 8257
8086 pin diagram description
8085 branching instruction
Programmable peripheral interface 8255
General register organization (computer organization)
flag register of 8086
Pin diagram 8085
Logical instruction of 8085
Microprocessor 80386
Pentium processor
8085 microproceesor ppt
Difference b/w 8085 & 8086
8085-microprocessor
Ad

Similar to ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR (20)

PDF
itft-Instruction set-of-8085
PDF
8085 Instructions.pdf
PPTX
Types of instruction in 8085 microprocessor
PDF
Lecture 03 Arithmetic Group of Instructions
DOC
180410227 ae2406-lab-manual-doc
PDF
8085 instructions
PPTX
Arithmetic and logical instructions
PPT
8085 instruction set
PPT
MicroprocessorLecture_2_eightbit_microprocessor.ppt
PPT
Instruction set-of-8085
PDF
8085 arithmetic instructions
PPT
instruction-set-of-8085 (1).ppt
DOCX
Introduction to 8085 & it's description(includes basic lab experiments)
PDF
4CS3-MPI-Unit-2.pdf microprocessor and interface
PPT
Instruction set of 8085
PPT
Chapter 3 instruction set-of-8085
PDF
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
PPTX
Instruction set 8085
itft-Instruction set-of-8085
8085 Instructions.pdf
Types of instruction in 8085 microprocessor
Lecture 03 Arithmetic Group of Instructions
180410227 ae2406-lab-manual-doc
8085 instructions
Arithmetic and logical instructions
8085 instruction set
MicroprocessorLecture_2_eightbit_microprocessor.ppt
Instruction set-of-8085
8085 arithmetic instructions
instruction-set-of-8085 (1).ppt
Introduction to 8085 & it's description(includes basic lab experiments)
4CS3-MPI-Unit-2.pdf microprocessor and interface
Instruction set of 8085
Chapter 3 instruction set-of-8085
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
Instruction set 8085
Ad

More from RamaPrabha24 (11)

PPTX
Dynamic debugging in 8085 microprocessor
PPTX
programming techniques
PPTX
instruction format and addressing modes
PPTX
instruction set and classificaion
PPTX
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
PPTX
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
PPTX
PINDIAGRAM OF 8085 MICROPROCESSOR
PPT
memory classification
PPTX
Introduction to microprocessor
PPTX
Basic terms used in microprocessor
PPTX
Applets in Java
Dynamic debugging in 8085 microprocessor
programming techniques
instruction format and addressing modes
instruction set and classificaion
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
PINDIAGRAM OF 8085 MICROPROCESSOR
memory classification
Introduction to microprocessor
Basic terms used in microprocessor
Applets in Java

Recently uploaded (20)

PPT
Mechanical Engineering MATERIALS Selection
PDF
composite construction of structures.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Well-logging-methods_new................
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
DOCX
573137875-Attendance-Management-System-original
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
PPT on Performance Review to get promotions
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mechanical Engineering MATERIALS Selection
composite construction of structures.pdf
Internet of Things (IOT) - A guide to understanding
CYBER-CRIMES AND SECURITY A guide to understanding
OOP with Java - Java Introduction (Basics)
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Well-logging-methods_new................
UNIT-1 - COAL BASED THERMAL POWER PLANTS
573137875-Attendance-Management-System-original
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPT on Performance Review to get promotions
Structs to JSON How Go Powers REST APIs.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Sustainable Sites - Green Building Construction
bas. eng. economics group 4 presentation 1.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Arduino robotics embedded978-1-4302-3184-4.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf

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