我编写了一个循环,它接受一个10位数的数组并将它们连接成一个大的输出字符串。但是,当它进入我的内环以检查字符串中有多少个字符时,它会计算太多次。对于为什么会发生这种情况的任何想法?
scoreArray =是1 2 3 4 5 6 7 8 9 10
counter2以第一个元素
的11字节值结束 while3:
mov counter2, 0
mov edx, 0
dtoa temp2, scoreArray[ebx] ; store each value in temp2 as string
add ebx, 4
cmp ebx, 44
je endWhile3
;problem area
innerLoop3:
cmp temp2[edx], 0 ; check to see if there is a space
je concLoop ; if there is, jump to concLoop
inc counter2 ; add another Byte to the total
inc edx
jmp innerLoop3
concLoop:
;inc counter2
mov eax, countTotal
lea esi, temp2
lea edi, outString+17+[eax]+1+17
cld
mov ecx, counter2
rep movsb
add eax, counter2
mov countTotal, eax
jmp while3
endWhile3: