Debug (command)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Original author(s) Tim Paterson
Developer(s) Microsoft
Type Debugger
License Proprietary commercial software
Website Debug

debug is a command in DOS, MS-DOS, OS/2 and Microsoft Windows (only in 32bit[1]) which runs the program debug.exe (or DEBUG.COM in older versions of DOS).[2] Debug can act as an assembler, disassembler, or hex dump program allowing users to interactively examine memory contents (in assembly language, hexadecimal or ASCII), make changes, and selectively execute COM, EXE and other file types. It also has several subcommands which are used to access specific disk sectors, I/O ports and memory addresses.[3] MS-DOS Debug runs at a 16-bit process level and therefore it is limited to 16-bit computer programs.[2] FreeDOS Debug has a "DEBUGX" version supporting 32-bit DPMI programs as well.[4]



  • It can only access 16-bit registers and not 32-bit extended registers.
  • When the "n" subcommand for naming files is used the filename is stored from offset DS:5D to DS:67 meaning that the program can only save files in FAT 8.3 filename format.
  • MS-DOS Debug can only access conventional memory,[2] which is the first 640 kB in an IBM PC.

FreeDOS offers a 32-bit clone.[4] Andreas "Japheth" Grech, the author of the HX DOS extender, developed enhanced DEBUG versions 0.98…1.25, and former PC DOS developer Vernon Brooks added versions 1.26…1.29b.[5]



When Debug is started without any parameters the Debug prompt, a "-", appears. The user can then enter one of several one or two-letter subcommands, including "a" to enter the assembler mode, "d" to perform a hexadecimal dump, "t" to trace and "u" to unassemble (disassemble) a program in memory.[6] Debug can also be used as a "debug script" interpreter using the following syntax.

debug < FileName 

A script file may contain Debug subcommands and assembly language instructions.[3] This method can be used to create or edit binary files from batch files.[2]

See also[edit]


  2. ^ a b c d Daniel B. Sedory. "A Guide to DEBUG". Retrieved 2007-05-25. 
  3. ^ a b "Using Debug". Retrieved 2007-06-23. 
  4. ^ a b Paul Vojta. "FreeDOS DEBUG README". Retrieved 2007-06-25. 
  5. ^ Vernon Brook (2014-02-11). "Enhanced DEBUG for PC DOS and MS-DOS". PC DOS Retro. Retrieved 2014-02-13. 
  6. ^ "Microsoft TechNet Debug article". Retrieved 2008-04-23.