Debug (command)

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found.

Debug
300px
Original author(s) Tim Paterson
Developer(s) Microsoft
Operating system DOS, MS-DOS, OS/2, Microsoft Windows
Type Debugger
License Proprietary commercial software
Website Debug

debug is a command in 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]

Background

Traditionally, all computers and operating systems have included a maintenance function, used to determine whether a program is working correctly.[citation needed] Debug was written by Tim Paterson to serve this purpose in QDOS. When Paterson began working for Microsoft in the early 1980s he brought the program with him. Debug was part of DOS 1.00 and has been included in MS-DOS and Microsoft Windows. DOS debug has several limitations:

Enhanced DEBUG package includes a 32-bit clone "DEBUGX" version supporting 32-bit DPMI programs as well.[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.30.[5]

Syntax

debug [[drive:][path] filename [parameters]]

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]

Using for non-debugging purposes

Debug utility was useful for binary files editing in the environment where only MS-DOS is installed without anything else. Another purpose is disk sectors editing, for example, in order to cure from boot-viruses of MS-DOS era.

See also

References

<templatestyles src="Reflist/styles.css" />

Cite error: Invalid <references> tag; parameter "group" is allowed only.

Use <references />, or <references group="..." />
  1. According to Microsoft Macro Assembler Reference, inline assembly is not supported for x64.
  2. 2.0 2.1 Lua error in package.lua at line 80: module 'strict' not found.
  3. 3.0 3.1 Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.