Anda di halaman 1dari 2

Computer Department

Quality Manual

A R Kalsekar Polytechnic

Program No. 2a
Write an assembly language program to add two 16 bit numbers
Refer: prog2a.asm
Tools: Turbo Assembler (TASM) 1.4
Program:
assume cs : code
assume ds : data
data segment
a dw 1191h
b dw 2272h
sum dw ?
data ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,0000h
mov ax,a
mov bx,b
add ax,bx
mov sum,ax
int 3
code ends
end start

9|P a ge

by Ubaid Saudagar

Computer Department

Quality Manual

A R Kalsekar Polytechnic

Observation:

Conclusion:
We observe that after adding the two 16 bit numbers, the result is stored in the
AX register which is the destination register which is also of 16 bits.
Since result is not generating carry, the carry flag is in reset state i.e. C=0.
When the 16 bit result is stored in the memory, it will be stored as 03 34, this is
because the lower byte of the AX register gets stored first and then the higher
byte.

10 | P a g e

by Ubaid Saudagar

Anda mungkin juga menyukai