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:
 assume cs: code 
Code segment
Start:
Mov ax, cs
Mov ds, ax
Mov si, offset do0
Mov ax, 0
Mov es, ax
Mov di, 200 h
Cx, mov offset do0end - offset do0
CLD
Rep movsb

Mov ax, 0
Mov es, ax
Mov word PTR es: * 4 0 and 3, 200 h
Mov word PTR es: [0 * 4 + 2], 0

Mov ax, 4 c00h
Int 21 h
Do0:
Mov ax, cs
Mov ds, ax
Mov si, offset data - offset do0 + 200 h

Mov ax, 0 b800h
Mov es, ax
12 * 160 * 2 + 36 mov di,

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

CodePudding user response:

refer to the second floor zara's reply:
DOSBox just provide a simple DOS virtual environment, the interrupt if it is false; And # DIV/0 this exception, may also be in debug software debugging software,


But 21 interrupts can use?

CodePudding user response:

Is can run, but it is not used to thinking system underlying the specific content, as if to have seen a lot of the interrupt vector is the same, this is clearly impossible, then look overseas entrance, code is also not as usual, So, I think it's these are Virtual, and other such Virtual PC or VMWare Virtual machine, and then ask the example, an old DOS the three games before, encrypted, with a floppy disk, caught the floppy disk image, VPC will run failure, VMWare can, this is probably the VPC Virtual than VMW real, now, it seems, DosBox more Virtual,

CodePudding user response:

reference 3 floor early play play nuclear response:
from the instruction encoding, FE 38 seems to be inc bh, don't know why you didn't identify the debug
debug to a lot of the data area??????? Does not admit, are all the Debug, or say that there is no corresponding instructions?

CodePudding user response:

reference 5 floor zara's reply:
is can run, but it is not used to thinking system underlying the specific content, as if to have seen a lot of the interrupt vector is the same, this is clearly impossible, then look overseas entrance, code is also not as usual, So, I think it's these are Virtual, and other such Virtual PC or VMWare Virtual machine, and then ask the example, an old DOS the three games before, encrypted, with a floppy disk, caught the floppy disk image, VPC will run failure, VMWare can, this is probably the VPC Virtual than VMW real, now, it seems, DosBox more Virtual,
sense

CodePudding user response:

DosBox can also build disk image in which the installation real DOS, compatibility will be better, in fact, DosBox supports DOS, win 3 x the best virtual machine software (98) can support to win, can support high resolution display mode, sound card, CDROM, string parallel port, than VirtualBox, VMWare is better, of course, not VirtualBox, VMWare can't do that, but they are not too concerned about too low end system virtualization,
  • Related