
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Add Content of One Segment to Another Segment in 8086
In this program we will see how to add two 8-bit numbers which are in different segments.
Problem Statement
Write 8086 Assembly language program to add content of memory location 2000:500 and 3000:600, and store the final result at 5000:700.
Discussion
Here we are initializing the CX register with the base address of first operand. Also store this into data segment register. Now take the number from offset 500 to AX. Now point CX to 3000, and load DS with 3000. Then add the AX with data at position 3000:0600, and store result at AX. Now again load CX as 5000, and store the AX value at offset 700.
Input
Address |
Data |
---|---|
… |
… |
2000:0500 |
2C |
… |
… |
3000:0600 |
4F |
… |
… |
Flow Diagram
Program
Output
Address |
Data |
---|---|
… |
… |
5000:0700 |
7B |
… |
… |
Advertisements