I have this really simple code that give me this error when I try to execute it:
Unhandled division by zero at address 004015DD (thread 0024), starting debugger...
But I have set the divisor used on the div instruction to 5:
.686
.xmm
.model flat, C
OPTION CaseMap:None
include ../masm32/libs/windows.inc
include ../masm32/libs/kernel32.inc
include ../masm32/libs/user32.inc
include ../masm32/libs/msvcrt.inc
include ../masm32/libs/masm32.inc
EXTERN printf:PROC
EXTERN scanf:PROC
.code
main PROC
push ebp
mov ebp,esp
mov eax,10
mov edx,5
div edx
push eax
push offset str_input_format
call printf
pop ebp
main ENDP
end
Why I'm getting this error? The divisor should be 5 not 0..