Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 5

Q.Assembly language program to add and sub two 8-bit and 16-bit numbers.

Program:

ADDITION SUBTRACTION
assume cs:code
assume cs:code assume ds:data
assume ds:data data segment
data segment a dw 1232h
a db 30h b dw 3486h
b db 20h c dw ?
c db ? d dw ?
d db ? ends data
ends data code segment
code segment start:
start:mov ax,data mov ax,data
mov ds,ax mov ds,ax
mov ax,0000h mov ax,0000h

mov al,a mov ax,a


mov bl,b mov bx,b
add al,bl add ax,bx
mov c,al mov c,ax
mov ax,a
sub al,bl sub ax,bx
mov d, al mov d,ax
int 03h int 3
ends code ends code
end start end start
Output:

You might also like