program to calculate sum of series.

 .model small

.data

array db 3h,2h,4h

msg db "Sum of series is:$"

sum db 0

.code

mov ax,@data

mov ds,ax

mov cx,3

mov si,offset array

up:

 mov al,[si]

add sum,al

inc si

loop up

mov ah,09h

lea dx,msg

int 21h

mov bl,sum

add bl,48

mov dl,bl

mov ah,02h

int 21h

mov ah,4ch

int 21h

end

Output:




Comments