| | |
divide overflow issue
![]() |
•
•
Join Date: Mar 2008
Posts: 5
Reputation:
Solved Threads: 0
Hi to all,
I wrote a code, and it gives me divide overflow, but the issue here is that when I run the program trough the debugger it works fine, but when I run the program in the dos mode it gives me Divide overflow error. here the code:
tnx
I wrote a code, and it gives me divide overflow, but the issue here is that when I run the program trough the debugger it works fine, but when I run the program in the dos mode it gives me Divide overflow error. here the code:
assembly Syntax (Toggle Plain Text)
prt_sig: mov al,[bx+si] mov ah,0 ;the maximum digit in a number is 3 push cx mov cx,3 pr: xor dx,dx push bx mov bx,10 div bx add dl,30h pop bx push dx xor ah,ah dec cx cmp cx,0 jne pr mov cx,3 prin: pop dx mov ah,02h int 21h loop prin
tnx
Last edited by Ancient Dragon; Jan 4th, 2009 at 6:12 pm. Reason: add code tags
•
•
•
•
Hi to all,
I wrote a code, and it gives me divide overflow, but the issue here is that when I run the program trough the debugger it works fine, but when I run the program in the dos mode it gives me Divide overflow error. here the code:
tnx
Nathan.
while (CPU is present) {some assembly required}
•
•
Join Date: Mar 2008
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Insert a CWD instruction right before the DIV instruction. This will sign-extend AX into the DX:AX pair needed for the ('dword' divided by 'word') division.
Nathan.
I tried to put cwd before the DIV instruction, but it still gives me DIVIDE OVERFLOW.....
![]() |
Similar Threads
- Won't load past startup; Divide overflow error? (Troubleshooting Dead Machines)
Other Threads in the Assembly Forum
- Previous Thread: Converting a string of numbers to an integer
- Next Thread: Assembly Symbols with the code?
| Thread Tools | Search this Thread |





