Enhanced DEBUG is a highly capable modern successor to the classic Microsoft MS-DOS DEBUG.COM utility. While the original MS-DOS version was capped by 1980s real-mode limitations and 16-bit constraints, Enhanced DEBUG (originally developed by Paul Vojta and maintained by developers like Andreas “Japheth” Grech) transforms the utility into a full-scale x86 debugger.
The transition from traditional DOS Debug to Enhanced DEBUG fundamentally overhauled five major architectural areas. 1. CPU Architecture & Instruction Support
The original MS-DOS DEBUG tool was effectively frozen in time. It could only assemble or disassemble 16-bit code natively targeting the Intel ⁄8088 processors.
Instruction Set Expansion: Enhanced DEBUG natively supports assembly and disassembly for all Intel x86 instructions up to the Pentium Pro (P6).
FPU & Extensions: It fully handles Floating Point Unit (FPU) math opcodes and adds partial support for modern extensions like MMX.
Architecture Declarations: You can force the debugger to evaluate code for specific CPUs using a new m [x] command (e.g., m 0 for an 8088, m 3 for a 386). The tool will proactively throw explicit warnings if you type an instruction incompatible with your specified target processor. 2. Modern 32-Bit Memory & DPMI Support
Classic DEBUG was restricted entirely to real-mode, 16-bit segments and a 1MB addressable limit. Enhanced DEBUG completely breaks this barrier, primarily through its sister variant, DEBUGX.COM.
DPMI Client Debugging: DEBUGX introduces full compatibility for debugging both 16-bit and 32-bit DOS Protected Mode Interface (DPMI) clients. It handles protected-mode environments inside engines like cwsdpmi or Windows NTVDM.
32-Bit Registers: It reads and manipulates full 32-bit extended registers (e.g., EAX, EBX, ESP) alongside traditional 16-bit registers (AX, BX, SP).
Protected-Mode Specific Commands: Enhanced DEBUG introduces distinct tools to peek under the hood of protected-mode memory: di: Displays interrupt vectors. dl: Displays Local Descriptor Table (LDT) descriptors. dx: Displays extended memory directly via Int 15h. 3. Context-Aware Visual Prompts
In standard MS-DOS DEBUG, you are given a singular, uninformative hyphen (-) command prompt regardless of system status. Enhanced DEBUG uses dynamic prompt prefixes to convey real-time system context: Meaning / Environmental Status - Standard prompt !-
Target program has been halted deep inside a DOS system call # The debugged program is running in Protected Mode !#
The program is trapped in a DPMI real-mode callback inside DOS >
The processor is actively running in Virtual 8086 (v86) Mode 4. Advanced System Isolation & Safety
Debugging in vanilla DOS was famously volatile; a crash in the program being tested often corrupted DEBUG itself or locked up the entire operating system.
Interrupt Isolation: Enhanced DEBUG automatically hooks, saves, and restores critical safety vectors—specifically Control-C (Int 23h) and Critical Error handlers (Int 24h). If your target program crashes, the debugger retains complete control of the machine.
Program Exit Inspection: When a debugged program terminates, Enhanced DEBUG automatically intercepts and displays the exact structural exit code via Int 21h (Function 4Dh). It explicitly spells out the high byte (Exit type: Normal, Ctrl-C, Critical Error, or TSR) and the low byte (Return code).
Video Page Flipping: To prevent a text-mode program’s visual layout from clobbering the debugger’s text interface, you can pass a /F switch. This forces Enhanced DEBUG to display on video Page 1 while the target program runs quietly on Page 0. (A quick v command flips back to see the program’s output). 5. Memory Footprint and Efficiency
Counterintuitively, despite packing vastly superior features, the optimized enhanced DEBUG.COM actually boasts a smaller memory footprint than its decades-old counterparts: MS-DOS 6.22 DEBUG: 23.0 KB PC DOS 7.0 DEBUG: 22.9 KB Enhanced DEBUG (v1.33): 20.5 KB
(Note: The heavy DPMI-capable DEBUGX.COM variant sits slightly higher at 25.5 KB).
If you are diving back into retro assembly or operating systems, you can find the complete DOS-debug Source Code repository on GitHub, which includes thorough architectural details in its official technical text files.
Are you planning to use Enhanced DEBUG for real-mode 16-bit programming, or are you aiming to analyze 32-bit protected-mode software? Knowing your specific use case will help me provide tailored command examples. Enhanced DEBUG for PC DOS and MS-DOS – PCjs Machines
Leave a Reply