Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Include Irvine32.inc
- .data
- total byte "result : ", 0dh, 0ah, 0
- intarray dword 1, 2, 3, 4
- sum dword 0
- .code
- main proc
- mov esi, offset intarray ; ESI = address of intarray
- mov ecx, lengthof intarray ; length of intarray
- mov eax, 0
- mov ebx, 0
- L1:
- add eax, [esi] ; add an array index
- add esi, type intarray ; point to next element
- add sum, eax
- call writeint
- call crlf
- Loop L1 ; repeat until ecx == 0
- mov edx, offset total
- call writestring
- mov ebx, sum
- call writeint
- exit
- main endp
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement