| | |
divide overflow???
![]() |
•
•
Join Date: Apr 2005
Posts: 6
Reputation:
Solved Threads: 0
hi... ive tried alot of things already...and i know what the problem is, just not sure how to fix it.
ive isolated it to this part of the code thats giving me problems... and i think that its because the register cant hold the number (hence the overflow error)
number will be from 100-999
since my div skills arent that great...what is the best way to divide something? my book isnt very helpful.
thanks
-g
ive isolated it to this part of the code thats giving me problems... and i think that its because the register cant hold the number (hence the overflow error)
Assembly Syntax (Toggle Plain Text)
MOV AX, number ;for division MOV CX, 2d ;'' DIV CX ; AX (number) / CX (2) = n/2 in ax INC AX ;so now its n/2 +1 MOV countmax, AX ;store max var.
since my div skills arent that great...what is the best way to divide something? my book isnt very helpful.
thanks
-g
•
•
Join Date: Sep 2005
Posts: 1
Reputation:
Solved Threads: 0
when we do "div",there some rules we must abide by.
1.8 digits "div",like
mov bh,1
mov ax,11
div bh
send the quotient to al, and send the arithmetical complimentremainder to ah
2. 16 digits "div",like
mov bx,11
mov ax,3223
div bx
send the quotient to ax, and send the arithmetical complimentremainder to dx
so, if the quotient lager than al in 8 digits "div" and larger than ax in 16 digits "div", system will call 0 interrupt, and display "Divide overflow"
1.8 digits "div",like
mov bh,1
mov ax,11
div bh
send the quotient to al, and send the arithmetical complimentremainder to ah
2. 16 digits "div",like
mov bx,11
mov ax,3223
div bx
send the quotient to ax, and send the arithmetical complimentremainder to dx
so, if the quotient lager than al in 8 digits "div" and larger than ax in 16 digits "div", system will call 0 interrupt, and display "Divide overflow"
![]() |
Similar Threads
- Combinations(N choose R) ? (C)
- Won't load past startup; Divide overflow error? (Troubleshooting Dead Machines)
- How to be Crash Free (C++)
- It's Alive!! Program with a mind of it's own.... (Computer Science)
- never taught how to show the VAT of a total. I know that u divide by 1.175 (Visual Basic 4 / 5 / 6)
Other Threads in the Assembly Forum
- Previous Thread: Please AnyBody Can Help Me To Build Assembly Code Infix To Postfix It So Hard T_T
- Next Thread: Need help with basic assembly calculator
| Thread Tools | Search this Thread |





