You are on page 1of 3

Program to implement 8-bit Addition:

.model small
.data
msg db 10,13,"Addition of 2 8-bit decimal no$"
msg1 db 10,13,"Enter 1st no $"
msg2 db 10,13,"enter 2nd no $"
msg3 db 10,13,"Result = $"

.code
mov ax,@data
mov ds,ax

lea dx,msg
mov ah,09h
int 21h

lea dx,msg1
mov ah,09h
int 21h

mov ah,01h
int 21h
sub al,30h
mov cl,04h
shl al,cl

mov bl,al
mov ah,01h
int 21h

sub al,30h
add al,bl
mov bl,al

lea dx,msg2
mov ah,09h
int 21h

mov ah,01h
int 21h
sub al,30h
mov cl,04h
shl al,cl



mov bh,al
mov ah,01h
int 21h
sub al,30h
add al,bh
mov ah,01h
mov bh,01h

add al,bl
daa
mov bl,al
mov bh,al
lea dx,msg3
mov ah,09h
int 21h
jnc next
mov dl,31h
mov ah,02h
int 21h

next:
and bh,0f0h
and bl,0fh

mov cl,04h
shr bh,cl
add bh,30h
mov dl,bh
mov ah,02h
int 21h

add bl,30h
mov dl,bl
mov ah,02h
int 21h

.exit
end







OUTPUT:

You might also like