I'm using the Irvine32.inc library, and am having an issue with my L4 jump.
L1:
mov edx, offset optionPromptMsg
call WriteString
call ReadInt
mov ebx, 1
cmp eax, ebx
je L2 //if eax is 1, jump to l2, if eax is -1, jump l3
mov ebx, -1
cmp eax, ebx
je L3
mov ebx, -2
mov ecx, 2
cmp ebx, eax //if eax is less than -2 or more than 2 jump to L4
ja L4
cmp eax, ecx
ja L4
L2: call NextScore
L4: mov edx, offset optionErrorMsg
call WriteString
loop L1
L3 : call WriteScore
No matter how I format it, for some reason everytime L2: call NextScore is called, immediantly afterward L4 is called and I can't figure out why. NextScore is as follows...
NextScore PROC USES esi
mov edx, offset scorePromptMsg
call WriteString
call ReadInt
mov ebx, 0
mov ecx, 100
cmp ebx, eax
ja L1
cmp eax,ecx
ja L1
jmp L2
L1:
mov edx, offset scoreErrorMsg
call WriteString
L2:
mov scores[esi*4], eax
inc esi
ret
NextScore ENDP
As you see, NextScore reads in a value from 0-100 then, unsuccessfully at this time, adds that value to an array scores. For some reason it only adds duplicates of one number throughout the entire array,but that's an entirely different issue. Any thoughts or ideas are most appreciated!
Aucun commentaire:
Enregistrer un commentaire