Debugging Tools

When running and testing programs, you will find it easiest to use a debugger, a utility program that lets you single-step through a program, execute one statement at a time, restart the program, examine and modify variables, examine the runtime stack, examine the CPU registers, examine machine instructions, assemble new instructions, and run a program up to a breakpoint.

Depending on the type of target program you create and your current operating system, you can select some or all of the following debuggers:

32-Bit Protected Mode

Debugging 32-bit Programs in Visual Studio

16-Bit Real Mode

Your two primary choices are the Debug debugger (debug.exe) supplied free with MS-DOS and Windows, or the CodeView debugger (cv.exe) supplied by Microsoft with the MASM assembler.

Debug was the first MS-DOS debugger, modeled after the well known debugger named DDT from the CP/M operating system. (No, DDT did not refer to an insecticide--it stood for Dynamic Debugging Tool.) Debug is primitive, yet easy to use. You can code and assemble short programs on the spot, without having to use any other assembler. It has some serious limitations: It does not permit the use of variable names or 32-bit registers, and doesn't let you edit existing programs. You can learn most of its commands with one hour. I used it for many years before CodeView appeared, primarily for testing the behavior of short instruction sequences.

CodeView is a full-featured professional debugger Microsoft developed somewhere between 1985 and 1992. It lets you open multiple memory and register windows, use the mouse, set multiple breakpoints, change the display format, set colors, and so on. It is not suited to assembling programs from scratch. Plan on spending about 3-4 hours learning its various commands. It has not been modified since 1992.

Borland's Turbo Debugger is similar to CodeView, with a better engineered user interface. It's probably the best 16-bit debugger around. It is bundled with Borland Turbo Assembler and Borland C++, so you have to buy one of those products to get the debugger. (Borland Assembler is not compatible with MASM 6.)

 

Updated 11/21/2019