include irvine32.inc
.data
array dword 10000h,20000h,30000h,20000h,10000h
thesum dword ?
.code
arraysum proc
push esi
push ecx
mov eax,0
L1:
add eax,[esi]
add esi,type dword
LOOP L1
pop ecx
pop esi
ret
arraysum endp
main proc
mov esi,offset array
mov ecx,lengthof array
call arraysum
mov thesum,eax
call writeint
call dumpregs
exit
main endp
end main