Home > other > DOSBOX under 16 assembly, questions about the divide overflow
DOSBOX under 16 assembly, questions about the divide overflow
Time:11-21
RT, I also saw Wang Shuang introduction to assembly language, in writing within the division overflow interrupt handling when wrote a program (test. The asm) :
Assume cs: code Code segment Start:
Mov ax, 0 FFFFH Mov bx, 1 Div bl
Mov ax, 4 c00h Int 21 h Code ends The end start
Under the DOSBox run, program has been running, don't quit, I use the debug debug step by step, find the default CPU divide overflow handler is an infinite loop... As follows:
When I first run after interruption of the loader, run the test again. Exe, interrupt handling will be normal, Interrupt loader (main. Asm) as follows:
Cx, mov 9 S: Mov al, [si] Mov es: (di), al Inc si The add di, 2 Loop s
Mov ax, 4 c00h Int 21 h Data: The db "overflow!" Do0end: The nop Code ends The end start
Excuse me, why DOSBox 16th in simulating environment, the system's own divide overflow treatment can lead to death cycle? (I'm Win10 64 enterprise edition 2004, inside the OS version 19041.450, set the v Code development environment, which use the masm - Code the plug-in)
CodePudding user response:
More surprisingly, without loading interrupt handling, I take the test. The asm to direct call int 0 h, the program can normal end, but not print any string
CodePudding user response:
DOSBox just provide a simple DOS virtual environment, the interrupt if it is false; And # DIV/0 this exception, in the debug software may also be debugging software,
CodePudding user response:
From the instruction encoding, FE 38 seems to be inc bh, don't know why you didn't identify the debug