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

posted on 2013-02-25 19:17  叶城宇  阅读(132)  评论(0编辑  收藏  举报