How to calculate sum of series in 8086 Assembly language

 


Program:

.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:


Download Tasm or Turbo Assembler here

Comments

  1. I'm drawn in by the introduction of this article. It is a truly a profitable article for us. Continue to post, Thank you.assembly language assignment help

    ReplyDelete

Post a Comment