还是除法溢出问题。。放了好久。求解决
.386
.model flat,stdcall
option casemap:none
includelib msvcrt.lib
printf proto c:dword,:vararg
.data
sum dword ?
szFmt byte 'sum is equ %d',0ah
szArry dword 1,2,3,4,5,6,7,8,9,10
ITEMS equ ($-szArry)/4
.code
start:
;求平均数
mov esi,0
mov ecx,10
mov eax,0
mov bx,0
f1:
add eax,szArry[esi*4]
inc esi
loop f1
mov ebx,10
div ebx
mov sum,eax
invoke printf ,offset szFmt,sum
ret
end start