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?


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:

?.This list of Debug commands.
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
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.
Srange listsearch
T[=address] [value]trace
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


  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/
7.1Win95 (OSR2.x) 20 554124/08/
Win98 20 554111/05/
Win98 SE 20 554123/04/

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

If you should have any comments or suggestions,
please contact: Bob Watson
This page last revised:
August 27, 2000.