Skip to content

VLSIFacts

Let's Program the Transistors

  • Home
  • DHD
    • Digital Electronics
    • Fault Tolerant System Design
    • TLM
    • Verification
    • Verilog
    • VHDL
    • Xilinx
  • Embedded System
    • 8085 uP
    • 8086 uP
    • 8051 uC
  • VLSI Technology
    • Analog Electronics
    • Memory Devices
    • VLSI Circuits
  • Interview
    • Interview Experience
    • Training Experience
    • Question Bank
  • Notifications
  • QUIZ
  • Community
  • Job Board
  • Contact Us

Addition of 16-bit Numbers in 8085

Posted on August 11, 2015May 18, 2025 By vlsifacts 1 Comment on Addition of 16-bit Numbers in 8085

This post would present you with assembly language program for 16-bit addition in 8085 microprocessor. The following Hex Code is a generic one for both no-carry and carry generation situation.

// Manually store 1st 16-bit number in the memory location 2000H & 2001H in reverse order
// For Example 1st number = B349H; i.e, 2000<-49H & 2001H<-B3H
// Manually store 2nd 16-bit number in the memory location 2002H & 2003H in reverse order
// For Example 2nd number = 81B6H; i.e, 2002<-B6H & 2003<-81H
// Store the result in the memory location 2004H, 2005H
// Store the carry in the memory location 2006H
// For this Example result will be B349H + 81B6H = 134FFH
// 2004<-FFH, 2005<-34H, 2006<-01H

#BEGIN 0000H       // Program counter will be loaded with 0000H
LHLD 2000H         // L<-49H, H<-B3H; HL=B349H
XCHG               // DE<-HL; DE = B349H
LHLD 2002H         // L<-B6H, H<-81H
MVI C,00H          // Clear the Register C
DAD D              // HL<-HL+DE; HL<-34FFH
JNC LABEL          // Jump to the position LABEL
INR C              // C<-01H

LABEL: SHLD 2004H  // 2004H<-FFH, 2005H<-34H
       MOV A,C     // A<-C
       STA 2006H   // 2006<-01H
HLT                // Stop the Program

#ORG 2000H         // Loads the DB values starting from this address
#DB 49H,B3H,B6H,81H

Memory Location

Input

2000     2001     2002     2003

49         B3        B6         81

Output

2004     2005     2006

FF        34         01

Note: The above Hex code has been assembled and simulated on Jubin’s 8085 Simulator. If you find any error wile assembling the above code then just remove the comment lines written right to the code lines.

Spread the Word

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Related posts:

  1. Multiplication of 8-Bit Numbers in 8085 Microprocessor: Illustration of 3 Different Cases
  2. Addition of 8-bit Numbers in 8085
  3. Assembly Language Program for Unpacking the Packed BCD number in 8085 Microprocessor
  4. Cisco Systems Interview Question Bank – Part 4
8085 uP, Embedded System Tags:16-bit addition, 8085 addition, 8085 Lab, Carry, Microprocessor Lab

Post navigation

Previous Post: Addition of 8-bit Numbers in 8085
Next Post: Difference between Microprocessor & Microcontroller

Comment (1) on “Addition of 16-bit Numbers in 8085”

  1. Arete says:
    December 31, 2019 at 12:05 am

    Does anyone have a program that will add ‘n’ 16-bit numbers. Where the 16-bit numbers are stored as follows: Address 0042H contains the count. The operands are in consecutive locations starting from address 0043H containing LSB and the next address 0044H contains MSB, and so on. Also assume that the sum can be contained in 16 bits – no carries. So if three numbers are being added, the program would load the LSB and MSB of each number – accessing 6 address locations, adding them as they are read.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top Posts & Pages

  • ASCII Code
  • Truth Tables, Characteristic Equations and Excitation Tables of Different Flipflops
  • Circuit Design of a 4-bit Binary Counter Using D Flip-flops
  • AND and OR gate using CMOS Technology
  • Artificial Intelligence & Machine Learning in VLSI: Opportunities, Algorithms, and Trends

Copyright © 2025 VLSIFacts.

Powered by PressBook WordPress theme

Subscribe to Our Newsletter

%d