The Assembly Programming Master Book

If any debug information was included in the executable file, then the debugger from that manufacturer allows you to work simultaneously with the program source code and with the disassembled code. This feature is convenient for high-level languages. For Assembly programs, this is a powerful debugging tool.

Suppose that the source code of your program is stored in the PROG.ASM file. To include the debug information into the executable module, use the following command-line options:

MASM

ML /c /coff / /Zd /Zi prog.asm LINK /subsystem:windows /debug prog.obj

In this case, in addition to the PROG.EXE file, the PROG.PDB file will be created and saved on the hard disk. Now, to debug the program, you'll have to start the Microsoft's 32-bit debuggerCode View.

TASM

TASM32 /ml /zi prog.asm TLINK32 -aa -v prog.obj

As a result of running the linker with these command-line options, the debug information will be included into the PROG.EXE executable module. For debugging of this module, use the 32-bit Turbo DebuggerTD32.EXE. Fig. 5.1 shows the debugger window with the program being debugged . As can be seen from this illustration, the window displays both the program source code and its disassembled code. More detailed information on debuggers will be provided in the last part of this book.

Figure 5.1: The TD32.EXE program window with the program being debugged

Категории