Tuesday 20 November 2012

PROGRAM FOR ADDITION OF SERIES OF 8 BIT NUMBERS

mmicroprocessor.blogspot.com
.model small

.data
list db 34h,32h,33h

.code
.startup
mov cl,2
mov si,offset list
mov al,[si]
l1:
add al,[si+1]
inc si
loop l1
mov dl,al
mov bh,al
and dl,0f0h
mov cl,4
ror dl,cl
add dl,30h
cmp dl,'9'
jbe a1
add dl,7h
a1:
mov ah,02h
int 21h
mov dl,bh
and dl,0fh
add dl,30h
cmp dl,'9'
jbe a0
add dl,7h
a0:
mov ah,02h
int 21h
mov ah,4ch
int 21h
end


Output:
99

No comments:

Post a Comment