Home » Embedded Systems

Addition of two 16 bits numbers in 8085 Microprocessor using 16 bits operation

Here, we are going to learn how to add two numbers of two 16 bits numbers in 8085 microprocessor using 16 bits operations?
Submitted by Akash Kumar, on October 30, 2018

Problem statement:

To add two 16 bits numbers in 8085 Microprocessor using 16 bits operation.

Algorithm:

  1. Load both the lower bit and higher bit of first number at once.
  2. Copy the content HL pair to DE pair register.
  3. Now the load the lower and higher bit of second number in HL pair register.
  4. ADD both the register pair content using DAD operation.
  5. Now move the result at memory location.

Program:

    LHLD    2050
    XCHG
    LHLD    2052
    DAD     D
    SHLD    2054
    HLT

Observation:

    INPUT: 
    2050:11
    2051:11
    2052:22
    2053:22

    OUTPUT: 
    2054:33
    2055:33

Hence, we successfully added two 16 bits numbers using 16 bits operation.






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.