Home »
Embedded Systems
Addition of three 16 bits numbers | 8085 Microprocessor
Here, we are going to learn how to find addition of three 16 bits numbers on 8085 microprocessor?
Submitted by Akash Kumar, on November 05, 2018
Problem statement:
To perform addition operation between three 16 bit numbers that is stored on registers using 8085 Microprocessor.
Assumption:
- Numbers are already stored on registers.
- While choosing the numbers we have to keep in mind that the sum of these numbers should not be greater than FFFF.
Algorithm:
- Add the content stored at HL pair register with the content of DE pair register and result will be stored at HL pair register.
- Now move the content of register B to register D and content of register C to register E.
- Now perform the step 1 again.
- The result will be stored at HL pair register.
Program:
DAD D
MOV E, C
MOV D, B
DAD D
HLT
Observation:
INPUT:
B:04
C:02
D:02
E:02
H:03
L:04
OUTPUT:
H:09
L:08
Hence we successfully added three 16 bits numbers that are stored on registers.
TOP Interview Coding Problems/Challenges