- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8085 program to add three 16 bit numbers stored in registers
In this program we will see how to add three 16-bit numbers stored in register pairs.
Problem Statement
Write 8085 Assembly language program to add three 16-bit numbers stored in register pair BC, DE and HL. Store the result at DE register pair.
Discussion
In this program we are storing the 16-bit numbers into BC, DE and HL pair. We have DAD D instruction which helps to add HL and DE register pair, and store the result into HL pair. After that copy BC to DE, then again perform DAD D to add them. Finally using XCHG we are storing them into DE register pair.
Here we are adding 0502H + 1211H + 2133H = 3846H
Input
Register | Data |
---|---|
BC | 0502 |
DE | 1211 |
HL | 2133 |
Flow Diagram
Program
Address | HEX Codes | Labels | Mnemonics | Comments |
---|---|---|---|---|
F000 | 01, 02, 05 | | LXI B,0502H | |
F003 | 11, 11, 12 | | LXI D,1211H | |
F006 | 21, 33, 21 | | LXI H,2133H | |
F009 | 19 | | DAD D | Add DE and HL, and Store into HL |
F00A | 50 | | MOV D,B | Copy B to D |
F00B | 59 | | MOV E,C | Copy C to E |
F00C | 19 | | DAD D | Add DE and HL (Actually BC), store into HL |
F00D | EB | | XCHG | Swap DE and HL |
F00E | 76 | | HLT | terminate the program |
Output
Register | Data |
---|---|
DE | 3846 |
- Related Articles
- 8085 program to add two 16 bit numbers
- 8085 program to divide two 16 bit numbers
- 8085 Program to multiply two 16-bit binary numbers
- 8085 Program to Add two 8 Bit numbers
- Program to multiply two 16-bit binary numbers in 8085 Microprocessor
- Program to Add two 8 Bit numbers in 8085 Microprocessor
- 8085 program to reverse 16 bit number
- 8085 program to swap two 16-bit numbers using Direct addressing mode
- 8086 program to add two 16 bit BCD numbers with carry
- 8085 Program to multiply two 8-bit numbers (shift and add method)
- 8086 program to add two 16-bit numbers with or without carry
- Program to multiply two 8-bit numbers (shift and add method) in 8085 Microprocessor
- 8085 Program to Divide a 16-bit number by an 8-bit number
- 8085 Program to Subtract two 8 Bit numbers
- 8085 Program to Divide two 8 Bit numbers

Advertisements