×

Embedded Systems Tutorial

AVR Microcontroller

8051 Microcontroller

8085 Microprocessor

8086 Microprocessor

8255 Microprocessor

Embedded Systems Practice

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

  1. Load HL pair with initial data using LHLD command.
  2. Move the data of the register L into the accumulator.
  3. Add the contents of accumulator and register H and store the result into accumulator.
  4. Move back the data of the accumulatorinto the register L.
  5. Initialize accumulator with 0.
  6. Use the ADC command to add the accumulator and the carry bit.
  7. Move the data of accumulator into register H.
  8. Store the data of HL pair into desired location using SHLD command.
  9. 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.




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.