I have a lab project to add 5 numbers inside an array with a size of WORD. I thought I was doing it correctly, but I am missing something (logic wise as well).
INCLUDE Irvine32.inc
.data
intarray DWORD 5,6,7,8,9 ; Declares a WORD array with 1,2,3,4,5
intsum DWORD 0 ; where I want the answer to go (Total should be 35)
.code
main PROC
MOV eax, intarray ; EAX = intarray
MOV ecx, intsum ; ECX = 0
L1:
add eax, ecx
loop L1
CALL DumpRegs
MOV edi, OFFSET intarray
MOV ebx, SIZEOF intarray
MOV ecx, 1
CALL DumpMem
CALL WriteINT
exit
main ENDP
END main
The program runs but its not giving me the correct answer. It should display 35 but I have the feeling I am not including the whole array. Can someone help me out?