flat assembler
Message board for the users of flat assembler.
Index
> DOS > mov ah,al + div bl = crash ?? |
Author |
|
Tomasz Grysztar 16 Dec 2006, 13:22
Karl20001 wrote: The mov bl,4 is to show that there is no divide by zero. The exception 0, though sometimes called "division by 0" is really a "division overflow". It occurs when divisor is too small to get a correct result that would fit into the destination register (AL in this case, since DIV BL divides AX=AH:AL by BL and stores quotient in AL and remainder in AH. In this case the result of division is simply too large to fit into AL and exception occurs. In general, the exception 0 on 8-bit division will occur when divisor (in this case BL) is smaller or equal to AH. Similarly in case of 16-bit division the exception will happen when divisor isn't greater than DX, etc. |
|||
16 Dec 2006, 13:22 |
|
Karl20001 16 Dec 2006, 13:55
Big thanks, i didnt know that
|
|||
16 Dec 2006, 13:55 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.