org 100h
.model small
.data
sum db 0
temp db 0
.code
mov cx,5 ; number of time the loop will execute
proc main
mov dx,@data
mov ds,dx
level:
add temp,2 ;add the position value
mov dl,temp
add sum,dl ; add temp to the sum
loop level
mov ah,4ch
int 21h
endp
end main
Add your comment