Debug

Index

Debug is a byte editor that enables files to be viewed and modified at the byte level. It is generally recommended that this utility is not used by the faint of heart or when under the influence of drugs or alcohol. There is no "undo" command, so make a backup before playing, eh?

Syntax:

DEBUG [filename]

Once Debug has been called, the somewhat cryptic "Debug prompt", a hyphen (-), is displayed. At the prompt, the following "Debug commands" are valid:

CommandParametersAction
?.This list of Debug commands.
A[address]assemble
Crange addresscompare
D[startaddress [endaddress|L range]]Displays (part of) a segment of memory. By default startaddress is offset 100 of the first free segment of memory, or offset 100 of the segment containing a file loaded by Debug. The default endaddress is 017F (ie. a range of 128 bytes).
Eaddress [list]enter
Frange listfill
G[=address] [addresses]go
Hvalue1 value2hex
Iportinput
L-Loads a previously "named" (see N) file into memory where it can be viewed/edited.
LnumberUsed with commands accepting a "range" argument to denote a number of bytes. Typically used in arguments as: startaddress L number. If number should take endaddress past the end of the segment, then number is truncated so the endaddress is the last byte of the segment.
Mrange addressmove
N[path] filename [arglist]"Names" a file for Debug. A file must be "named" before it can be loaded for viewing/editing.
Oport byteoutput
P[=address] [number]proceed
Q.Exit Debug.
R[register]register
Srange listsearch
T[=address] [value]trace
U[range]unassemble
W[address] [drive] [firstsector] [number]write
XA[#pages]allocate expanded memory
XD[handle]de-allocate expanded memory
XM[Lpage] [Ppage] [handle]map expanded memory pages
XS.display expanded memory status

Notes

  1. Debug.exe is one of those little programs that, in the hands of a skilled user, is an amazingly powerful tool with which one can view and edit the contents of memory both short term (RAM) and long term (hard/floppy/tape media). One can also compile (and, up to a point, decompile) assembly language code.
  2. After struggling for some time to come to grips with the ins and outs of Debug, I have finally decided to leave the explanations to others.

File Details

File NameDefault LocationDos Ver.Win Ver.SizeDateSource
Debug.exec:\windows\command 7.0Win95 20 52211/07/95win95_02.cab
7.1Win95 (OSR2.x) 20 554124/08/96win95_02.cab
Win98 20 554111/05/98win98_40.cab
Win98 SE 20 554123/04/99win98_45.cab

Superscripts denote which same size files, if any, are identical (using FC).

Further Reference

DOS Debug Tutorial
- Fran Golden
A comprehensive guide to DEBUG that starts with an introduction to machine code, moves on to assembly language

This page last revised:
March 2, 2001.