.model small
.data
x db 20 dup(0)
y db "enter the nos $"
z db 0ah, 0dh, "Sum is $"
.code
.startup
mov ah,09h
lea dx,y
int 21h
mov si,00h
mov bh,00h
l:
mov ah,01h
int 21h
cmp al,0dh
je l1
sub al,30h
mov x[si],al
inc si
inc bh
jmp l
l1:
mov si,00h
mov ah,00h
mov cl,bh
l2:
add al,x[si]
inc si
loop l2
mov ah,09h
lea dx,z
int 21h
l3:
mov bl,0ah
div bl
mov dl,al
add dl,30h
mov ah,02h
int 21h
mov dl,ah
add dl,30h
mov ah,02h
int 21h
e:
.exit
end