PhysicsTeacher.in

High School Physics

Arithmetic Instructions in 8085 – PhysicsTeacher.in

Last updated on March 10th, 2022 at 04:44 pm

In this post, we will discuss the Arithmetic Instructions in the 8085 Microprocessor required for arithmetic operations.

Arithmetic operations supported by the 8085 Microprocessor are addition, subtraction, and their variants.

The arithmetic instructions in the 8085 microprocessor are described here in detail.


Addition (ADD, ADI)

With the Addition instruction, the following 3 operations can be done:

  • Any 8-bit number can be added to the contents of the accumulator and the result is stored in the accumulator.
  • The contents of a register can be added to the contents of the accumulator and the result is stored in the accumulator.
  • The contents of a memory location can be added to the contents of the accumulator and the result is stored in the accumulator.

Subtraction (SUB, SUI)

With the Subtraction instruction, the following 3 operations can be done:

  • Any 8-bit number Can be subtracted from the contents of the accumulator. The result is stored in the accumulator.
  • The contents of a register Can be subtracted from the contents of the accumulator. The result is stored in the accumulator.
  • The contents of a memory location Can be subtracted from the contents of the accumulator. The result is stored in the accumulator.

Add–with–carry (ADC, ACI)

Add–with–carry instructions are used for multi-byte and higher-order byte addition.

Subtract-with-borrow (SBB, SBI)

Subtract-with-borrow instructions are used for multi-byte and higher-order byte subtraction.

Arithmetic Operations Related to Memory

These instructions perform an arithmetic operation using the contents of a memory location while they are still in memory.

ADD M // Add the contents of M to the Accumulator

SUB M // Sub the contents of M from the Accumulator

INR M / DCR M // Increment/decrement the contents of the memory location in place.

All of these use the contents of the HL register pair to identify the memory location being used.

Increment (INR) and decrement (DCR)

The 8-bit contents of any memory location or any register can be directly incremented or decremented by 1. No need to disturb the contents of the accumulator.

Manipulating Addresses

Now that we have a 16-bit address in a register pair, how do we manipulate it?

It is possible to manipulate a 16-bit address to increment register pair as one entity using some special instructions.

INX Rp (Increment the 16-bit number in the register pair)

DCX Rp (Decrement the 16-bit number in the register pair)

The register pair is incremented or decremented as one entity. No need to worry about a carry from the lower 8-bits to the upper. It is taken care of automatically.

Instruction for BCD addition

DAA is the 8085 instruction that supports BCD addition.

The addition of BCD is done like binary addition, using the ADD instruction.

DAA is used to convert the result of the binary sum into a BCD number. This instruction cannot be used to directly convert binary numbers into BCD numbers.

This instruction uses Auxiliary Carry and Carry flag to achieve this conversion.

During the execution of DAA instruction, the processor checks the lower order 4-bits in the Accumulator.

If it is greater than 9 or if the Auxiliary Carry flag is set, then 6 is added to this lower order nibble. Similarly, if the higher-order 4-bits is greater than 9 or if the Carry flag is set, then 6 is added to the higher-order 4-bits of the Accumulator.

The result of this operation in Accumulator will be the BCD equivalent of the sum.

Author of this post

This post is co-authored by Professor Saraswati Saha, who is an assistant professor at RCCIIT, a renowned degree engineering college in India. Professor Saha teaches subjects related to digital electronics & microprocessors.

Related Post (8085 microprocessor based)

8085 Interrupts with pdf download

8085 – methods of Data Transfer

Peripheral interface IC 8255

microprocessor fundamentals

8085 architecture – MCQ

MCQs on 8085 Instruction set, Addressing Modes & Machine cycles

8085 – program execution

How to Interface a RAM chip with 8085 microprocessor

Functional block diagram of Intel 8085 microprocessor and the functional units

General purpose registers of 8085 microprocessor

Special-purpose registers of 8085 microprocessor – FAQs

Architecture of 8085 microprocessor

Instruction Word flow diagram and Data Word flow diagram for Intel 8085 & 8086

Fetch Cycle, Instruction Cycle, Machine Cycle & T-state of 8085 & 8086 Microprocessor – FAQs

De-Multiplexing of AD0-AD7 in 8085 Microprocessor

Instruction Set and Types of instruction in 8085 microprocessor – FAQs

FAQs on addressing modes of instructions | execution of an instruction in 8085 microprocessor

Arithmetic Instructions in 8085 Microprocessor for Arithmetic operations: Revision notes

8085 Microprocessor – tutorials (hub)

Microprocessor class notes – PDF download

See also  Flag Register of 8086
Scroll to top
error: physicsTeacher.in