my goal is to add all the number in ary, but my problem seems to come on the command "add eax,[esi]" if anyone could give me some advice it would be greatly appreciated.
TITLE MASM Template (main.asm)
; Description:
;
; Revision date:
INCLUDE Irvine32.inc
.data
myMessage BYTE "MASM program example",0dh,0ah,0
ary dword 100, -50, 125, 94, 35, -92, 82, 634, 193, 99, -54, 1, -5, 200, 15
dword 81, 44, 143, 132, 52, -62, 38, 56, 42, -81, 55, 43, 121, 25, 0
.code
main PROC
call Clrscr
lea esi,ary ;
addloop: ;
add esi,4 ;
add eax, [esi] ;
cmp esi,0 ;
jne addloop ;
call DumpRegs
mov edx,offset myMessage
call WriteString
exit
main ENDP
END main
TITLE MASM Template (main.asm)
; Description:
;
; Revision date:
INCLUDE Irvine32.inc
.data
myMessage BYTE "MASM program example",0dh,0ah,0
ary dword 100, -50, 125, 94, 35, -92, 82, 634, 193, 99, -54, 1, -5, 200, 15
dword 81, 44, 143, 132, 52, -62, 38, 56, 42, -81, 55, 43, 121, 25, 0
.code
main PROC
call Clrscr
lea esi,ary ;
addloop: ;
add esi,4 ;
add eax, [esi] ;
cmp esi,0 ;
jne addloop ;
call DumpRegs
mov edx,offset myMessage
call WriteString
exit
main ENDP
END main