I am counting and adding digits from -17 to 5 i don't know if i did it right or not pls can some one help me pls. Here is my code it is giving me 17 as total.
.data
space byte " ",0
a dword -17
b dword 5
source dword 120 dup(0)
sumof byte "The sum of the source array is ",0
theSum DWORD ?
delta dword ?
.code
main PROC
mov eax,0
mov eax,b
sub eax,a
inc eax
mov delta,eax
mov edx,offset space
mov ecx,120
mov esi,0
l1:
mov eax,delta
call randomrange
inc eax
mov source[esi],eax
inc esi
loop l1
add eax,source[esi]
inc source[esi]
mov source[esi],eax
mov edx,offset sumof
call writestring
call writedec
call crlf
exit