Home »
Embedded Systems
Addition of Two 8-bit Numbers using 8085 Microprocessor with Carry
Add two 8-bit numbers with carry: In this tutorial, we will learn how to find the addition of two 8-bit numbers with carry using an 8085 microprocessor?
By Raju Singh Bhati Last updated : May 13, 2023
Addition of Two 8-bit Numbers using 8085 Microprocessor with Carry
Given two 8-bit numbers, we have to find their addition with carry using 8085 microprocessor.
Algorithm
- Load HL pair with initial data using LHLD command.
- Move the data of the register L into the accumulator.
- Add the contents of accumulator and register H and store the result into accumulator.
- Move back the data of the accumulatorinto the register L.
- Initialize accumulator with 0.
- Use the ADC command to add the accumulator and the carry bit.
- Move the data of accumulator into register H.
- Store the data of HL pair into desired location using SHLD command.
- Stop.
Program
2000 LHLD 2050
2003 MOV A, L
2004 ADD H
2005 MOV L, A
2006 MVI A 00
2008 ADC A
2009 MOV H, A
200A SHLD 3050
200D HLT
Observation
INPUT:
2050:15
2051:27
OUTPUT:
3050:3C (sum)
3051:00(carry)
Hence successfully added two 8-bits numbers with carry using 8085 microprocessor.