To start DEBUG, type:
DEBUG [d:][path][filename[.ext]][parm1][parm2]
If you enter filename, the DEBUG program loads the specified file
into memory. You may now type commands to alter, display, or execute
the contents of the specified file.
If you don't enter a filename, you must either work with the present
memory contents, or load the required file into memory by using the
Name and Load commands.
The optional parameters, parm1 and parm2, represent the optional for the
named filespec. For example,
DEBUG DISKCOMP.COM A: B:
In this command, the A: and B: are the parameters that DEBUG prepares
for the DISKCOMP program.
When the DEBUG program starts, the registers and flags are set to the
following values for the program being debugged:
■ The segment registers (CS, DS, ES, and SS) are set to the bottom
of free memory; that is, the first segment after the end of the
DEBUG program.
■ The Instruction Pointer (IP) is set to 0100h.
■ The Stack Pointer (SP) is set to the end of the segment, or the
bottom of the transient portion of the program loader, whichever
is lower. The segment size at offset 6 is reduced by 0100h to
allow for a stack that size.
■ The remaining registers (AX, BX, CX, DX, BP, SI, and DI) are set
to zero. However, if you start the DEBUG program with a filespec,
the CX register contains the length of the file in bytes. If the
file is greater than 64K, the length is contained in registers BX
and CX (the high portion in BX).
■ The initial state of the flags is:
NV UP EI PL NZ NA PO NC
■ The default disk transfer address (DTA) is set to 80h in the code
segment.
All of available memory is allocated; therefore, any attempt by the
loaded program to allocate memory fails.
Notes:
1. If a file loaded by DEBUG has an extension of .EXE, DEBUG does
the necessary relocation and sets the segment registers, stack
pointer, and instruction pointer to the values defined in the
file. The DS and ES registers, however, point to the Program
Segment Prefix (PSP) at the lowest available segment. The BX and
CX registers contain the size of the program (smaller than the
file size).
The program is loaded at the high end of memory if the appro-
priate parameter was specified when the linker created the file.
2. If a file loaded by DEBUG has an extension of .HEX, the file is
assumed to in INTEL hex format, and is converted to executable
form while being loaded.