When I try to divide, 1234567890 (10 digits; less than max unsigned int), I don't get int overflow When I try to divide, 2345678901 (10 digits; less than max unsigned int), I get int overflow.
When I divide the first number, EDX is filled with 0's, then I try the second number, EDX is filled with 1's.
An observation is that when I try to enter 2345678901 into my Windows programmer calculator set to DWORD, it won't let me enter the last digit (1). So I can enter 234567890.
What is another approach I can take? Not sure what else I need to do. I thought about zeroing out EAX, but that seems pointless when I am just going to mov the value into eax
xor edx, edx
; converts the string
NextDigit:
mov ebx, 10
cdq
div ebx
add edx, 48 ; add to remainder
push eax ; save eax (quotient)
mov eax, edx ; remainder + 48 into eax
The error: