Home » Embedded Systems

Addition of two 8-bits numbers in 8085 Microprocessor with carry

Here, we are going to learn how to find addition of two 8 bits number in 8085 Microprocessor with carry?
Submitted by Raju Singh Bhati, on October 18, 2018

Problem statement:

Addition of 2 8-bit numbers using 8085 microprocessor with carry.

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

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.