HOME

TheInfoList



OR:

The line-oriented
debugger A debugger or debugging tool is a computer program used to software testing, test and debugging, debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the pr ...
DEBUG.EXE is an external command in
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s such as
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
,
OS/2 OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 ...
and
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
(only in 16-bit/32-bit versions). DEBUG can act as an
assembler Assembler may refer to: Arts and media * Nobukazu Takemura, avant-garde electronic musician, stage name Assembler * Assemblers, a fictional race in the ''Star Wars'' universe * Assemblers, an alternative name of the superhero group Champions of ...
,
disassembler A disassembler is a computer program that translates machine language into assembly language—the inverse operation to that of an assembler. A disassembler differs from a decompiler, which targets a high-level language rather than an assembly lan ...
, or
hex dump In computing, a hex dump is a hexadecimal view (on screen or paper) of computer data, from memory or from a computer file or storage device. Looking at a hex dump of data is usually done in the context of either debugging, reverse engineering or ...
program allowing users to interactively examine
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembered, ...
contents (in
assembly language In computer programming, assembly language (or assembler language, or symbolic machine code), often referred to simply as Assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence be ...
,
hexadecimal In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, hexa ...
or
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
), make changes, and selectively execute
COM Com or COM may refer to: Computing * COM (hardware interface), a serial port interface on IBM PC-compatible computers * COM file, or .com file, short for "command", a file extension for an executable file in MS-DOS * .com, an Internet top-level d ...
,
EXE Exe or EXE may refer to: * .exe, a file extension * exe., abbreviation for executive Places * River Exe, in England * Exe Estuary, in England * Exe Island, in Exeter, England Transportation and vehicles * Exe (locomotive), a British locomotive ...
and other file types. It also has several subcommands which are used to access specific
disk sector In computer disk storage, a sector is a subdivision of a track on a magnetic disk or optical disc. Each sector stores a fixed amount of user-accessible data, traditionally 512 bytes for hard disk drives (HDDs) and 2048 bytes for CD-ROMs and D ...
s,
I/O port Memory-mapped I/O (MMIO) and port-mapped I/O (PMIO) are two complementary methods of performing input/output (I/O) between the central processing unit (CPU) and peripheral devices in a computer. An alternative approach is using dedicated I/O pro ...
s and
memory address In computing, a memory address is a reference to a specific memory location used at various levels by software and hardware. Memory addresses are fixed-length sequences of digits conventionally displayed and manipulated as unsigned integers. Su ...
es.


Overview

Traditionally, all
computers A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations (computation) automatically. Modern digital electronic computers can perform generic sets of operations known as programs. These programs ...
and
operating systems An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also inc ...
have included a maintenance function, used to determine whether a program is working correctly. DEBUG was originally written by
Tim Paterson Tim Paterson (born 1 June 1956) is an American computer programmer, best known for creating 86-DOS, an operating system for the Intel 8086. This system emulated the application programming interface (API) of CP/M, which was created by Gary Kild ...
to serve this purpose in
86-DOS 86-DOS (known internally as QDOS, for Quick and Dirty Operating System) is a discontinued operating system developed and marketed by Seattle Computer Products (SCP) for its Intel 8086-based computer kit. 86-DOS shared a few of its commands wit ...
. When Paterson began working for Microsoft in the early 1980s he brought the program with him. DEBUG was part of and has been included in
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few ope ...
/ PC DOS and certain versions of
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
. Originally named DEBUG.COM, the executable was renamed into DEBUG.EXE with MS-DOS 3.2.
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Windows 2000 for high-end and ...
and later versions included DEBUG for the MS-DOS subsystem to maintain MS-DOS compatibility. The 16-bit DOS commands are not available on
64-bit In computer architecture, 64-bit Integer (computer science), integers, memory addresses, or other Data (computing), data units are those that are 64 bits wide. Also, 64-bit central processing unit, CPUs and arithmetic logic unit, ALUs are those ...
editions of Windows. The MS-DOS/PC DOS DEBUG has several limitations: * In assembly/disassembly modes it only supports
8086 The 8086 (also called iAPX 86) is a 16-bit microprocessor chip designed by Intel between early 1976 and June 8, 1978, when it was released. The Intel 8088, released July 1, 1979, is a slightly modified chip with an external 8-bit data bus (allowi ...
opcodes. * 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 Offset or Off-Set may refer to: Arts, entertainment, and media * "Off-Set", a song by T.I. and Young Thug from the '' Furious 7: Original Motion Picture Soundtrack'' * ''Offset'' (EP), a 2018 EP by singer Kim Chung-ha * ''Offset'' (film), a 200 ...
DS:5D to DS:67 (the
Program Segment Prefix The Program Segment Prefix (PSP) is a data structure used in DOS systems to store the state of a program. It resembles the Zero Page in the CP/M operating system. The PSP has the following structure: The PSP is most often used to get the comm ...
File Control Block A File Control Block (FCB) is a file system structure in which the state of an open file is maintained. A FCB is managed by the operating system, but it resides in the memory of the program that uses the file, not in operating system memory. This ...
area), meaning that the program can only save files in FAT 8.3 filename format. Enhanced DEBUG packages include the DEBUG command in
Novell DOS 7 DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
,
OpenDOS 7.01 DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
and
DR-DOS 7.02 DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
and higher, a reimplementation of
Digital Research Digital Research, Inc. (DR or DRI) was a company created by Gary Kildall to market and develop his CP/M operating system and related 8-bit, 16-bit and 32-bit systems like MP/M, Concurrent DOS, FlexOS, Multiuser DOS, DOS Plus, DR DOS and ...
's former Symbolic Instruction Debugger SID/SID86, which came with former versions of
DR DOS DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
. It is fully compatible with the DEBUG command line syntax of MS-DOS/PC DOS, but offers many enhancements, including supporting 16-bit and 32-bit opcodes up to the
Pentium Pentium is a brand used for a series of x86 architecture-compatible microprocessors produced by Intel. The original Pentium processor from which the brand took its name was first released on March 22, 1993. After that, the Pentium II and Pe ...
, an extended mode (/X) with dozens of additional commands and sub-modes, a much enhanced command line syntax with user-definable macros and
symbolic debugging A debug symbol is a special kind of Symbol (programming), symbol that attaches additional information to the symbol table of an object file, such as a shared library or an executable. This information allows a symbolic debugger to gain access to i ...
facilities with named registers, loaded
symbol table In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier (or symbols), constants, procedures and functions in a program's source code is associated with info ...
s, mathematical operations and
base conversion Positional notation (or place-value notation, or positional numeral system) usually denotes the extension to any base of the Hindu–Arabic numeral system (or decimal system). More generally, a positional system is a numeral system in which th ...
s, as well as a
commenting disassembler A disassembler is a computer program that translates machine language into assembly language—the inverse operation to that of an assembler. A disassembler differs from a decompiler, which targets a high-level language rather than an assembly l ...
. Some versions also utilized DPMS to function as a "stealth mode" protected-mode debugger. The
FreeDOS FreeDOS (formerly Free-DOS and PD-DOS) is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running Legacy system, legacy software and supporting embedded system ...
version of DEBUG was developed by Paul Vojta and is licensed under the
MIT License The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts only very limited restriction on reuse and has, therefore, high license comp ...
. A 32-bit clone "DEBUGX" version supporting
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in 32-bit units. Compared to smaller bit widths, 32-bit computers can perform large calculation ...
DPMI programs exists as well. Andreas "Japheth" Grech, the author of the HX DOS extender, developed enhanced DEBUG versions 0.98 to 1.25, and former PC DOS developer Vernon C. Brooks added versions 1.26 to 1.32.


Syntax

DEBUG  drive:path] filename  arameters
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. 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. This method can be used to create or edit
binary file A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document fil ...
s from
batch file Batch may refer to: Food and drink * Batch (alcohol), an alcoholic fruit beverage * Batch loaf, a type of bread popular in Ireland * A dialect term for a bread roll used in North Warwickshire, Nuneaton and Coventry, as well as on the Wirral ...
s.


Using for non-debugging purposes

The DEBUG utility is useful for editing binary files in an environment where only DOS is installed without anything else. It can also be used to edit disk sectors, which is one method of removing boot-sector viruses.


Availability

Although technical documentation for the DEBUG command was removed with the release of MS-DOS 3.3, the command was retained in the standard distribution, unlike what was done with EXE2BIN.


DEBUG in other operating systems

The
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 seri ...
ISIS-II and iRMX 86, DEC
TOPS-10 TOPS-10 System (''Timesharing / Total Operating System-10'') is a discontinued operating system from Digital Equipment Corporation (DEC) for the PDP-10 (or DECsystem-10) mainframe computer family. Launched in 1967, TOPS-10 evolved from the earlier ...
and
TOPS-20 The TOPS-20 operating system by Digital Equipment Corporation (DEC) is a proprietary OS used on some of DEC's 36-bit mainframe computers. The Hardware Reference Manual was described as for "DECsystem-10/DECSYSTEM-20 Processor" (meaning the DEC PDP- ...
, THEOS/OASIS,
Zilog Zilog, Inc. is an American manufacturer of microprocessors and 8-bit and 16-bit microcontrollers. It is also a supplier of application-specific embedded system-on-chip (SoC) products. Its most famous product is the Z80 series of 8-bit microp ...
Z80-RIO The Z80 Operating System with Relocatable Modules and I/O Management (Z80-RIO) is a general-purpose operating system developed by Zilog in the late 1970s for various computer systems including the ''Z80 Micro Computer System'' (MCZ-1) series and t ...
,
Stratus Stratus may refer to: Weather *Stratus cloud, a cloud type **Nimbostratus cloud, a cloud type **Stratocumulus cloud, a cloud type **Altostratus cloud, a cloud type **Altostratus undulatus cloud, a cloud type **Cirrostratus cloud, a cloud type Mus ...
OpenVOS,
PC-MOS PC-MOS/386 is a multi-user, multitasking computer operating system produced by The Software Link (TSL), announced at COMDEX in November 1986 for February 1987 release. PC-MOS/386, a successor to PC-MOS, can run many MS-DOS programs on the host ...
, and
AROS Aros may refer to: *Aros (Middle-earth), a river in J. R. R. Tolkien's Middle-earth legendarium * Aros, Mull, the location of Aros Castle, a ruined 13th-century castle on the Isle of Mull, Scotland *AROS Research Operating System, a free software i ...
also provide a DEBUG command.


See also

*
List of DOS commands This article presents a list of commands used by DOS operating systems, especially as used on x86-based IBM PC compatibles (PCs). Other DOS operating systems are not part of the scope of this list. In DOS, many standard system commands were pro ...
* DDT (CP/M command) (Dynamic Debugging Technique) * SID (Symbolic Instruction Debugger) *
SYMDEB CodeView is a standalone debugger created by David Norris at Microsoft in 1985 as part of its development toolset. It originally shipped with Microsoft C 4.0 and later. It also shipped with Visual Basic (classic), Visual Basic for MS-DOS, Microso ...
*
CodeView CodeView is a standalone debugger created by David Norris at Microsoft in 1985 as part of its development toolset. It originally shipped with Microsoft C 4.0 and later. It also shipped with Visual Basic (classic), Visual Basic for MS-DOS, Microso ...
*
Turbo Debugger Turbo Debugger (TD) is a machine-level debugger for DOS executables, intended mainly for debugging Borland Turbo Pascal, and later Turbo C programs, sold by Borland. It is a full-screen debugger displaying both Turbo Pascal or Turbo C source and c ...
*
SoftICE SoftICE is a kernel mode debugger for DOS and Windows up to Windows XP. It is designed to run underneath Windows, so that the operating system is unaware of its presence. Unlike an application debugger, SoftICE is capable of suspending all oper ...
* DEBUG (tag)


References


External links


Debug , Microsoft Docs

Open source DEBUG implementation that comes with MS-DOS v2.0
{{Windows commands Assemblers Debuggers Disassemblers External DOS commands Microsoft free software OS/2 commands