I am having trouble with the .IF/.ELSEIF block of my MASM code. The "Yes" response (click of the button) triggers both a "Yes" and a "No" message, while the "No" response (click of the button) triggers just a "No" message (as expected/correctly). Using dumpregs we know that a value of 6 in eax means a "Yes" was triggered and a value of 7 in the eax means a "No" was triggered. So I'm not sure why my code is failing to work. Any guidance would be appreciated.
INCLUDE Irvine32.inc
.data
caption BYTE "Question?", 0
question BYTE "Were there really 3 different types of humans living at the same time?",0dh,0ah,0
yans BYTE "Correct! DNA convincingly shows 3 lineages: modern human, Neanderthal and Denisovan...and maybe 3 others."
nans BYTE "Wrong! Google is my friend."
.code
main PROC
mov ebx, OFFSET caption
mov edx, OFFSET question
call MsgBoxAsk
.IF eax == 6
mov edx, OFFSET yans
call WriteString
.ELSEIF eax == 7
mov edx, OFFSET nans
call WriteString
.ENDIF
exit
main ENDP
END main
When I press "Yes" I get the following error:
Correct! DNA convincingly shows 3 lineages: modern human, Neanderthal and Denisovan...and maybe 3 others.Wrong! Google is my friend.
C:\irvine\Project32_VS2019\Debug\Project.exe (process 9828) exited with code 0.
Press any key to close this window . . .
Aucun commentaire:
Enregistrer un commentaire