When debugging the following com file in MS-DOS, I can successfully run the program with
-g and it terminates normally, but when I trace it
-t 1000, the program throws an illegal operation exception and terminates after +/- 800 instructions. I traced the file manually, but I cannot see why it aborts (it does write to some data to the lower memory regions, but that shouldn't affect the debugger).
The COM file can be found here.
Both MS Debug and the Freedos
DEBUG.exe give the same results (albeit that they crash at a different point in the execution). Both the WinXP virtual x86 environment and dosbox give the same results.
Any thoughts on why this is happining?
EDIT: A trace can be found in this pastebin.
This trace was made with Dosbox running the FreeDOS debugger using these software.
I looked into the MASM code from the debugger: normally no INT3 should be used for a single-step trace. Also note the fact that all the registers and flags are messed up.