8086 program to add two 16-bit numbers with or without carry


In this program we will see how to add two 16-bit numbers with and without carry.

Problem Statement

Write 8086 Assembly language program to add two 16-bit number stored in memory location 3000H – 3001H and 3002H – 3003H.

Discussion

8086 is 16-bit register. We can simply take the numbers from memory to AX and BX register, then add them using ADD instruction. When the Carry is present store carry into memory, otherwise only store AX into memory.

  • We are taking two numbers BCAD + FE2D = 1BADA

Input:

Address
Data


3000
AD
3001
BC
3002
2D
3003
FE


 

Flow Diagram

 

Program

Output

Address
Data


3004
DA
3005
BA
3006
01


Updated on: 30-Jul-2019

15K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements