Debug (command)

Uses your system voice; voice and rate in settings.

Snapshot

≈ 5 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

The line-oriented debugger DEBUG.EXE is an external command in MS-DOS and compatible operating systems, OS/2, and 16 and 32-bit versions of Windows. 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.

The line-oriented debugger DEBUG.EXE is an external command in MS-DOS and compatible operating systems, OS/2, and 16 and 32-bit versions of Windows. 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. ==Overview== 1.0.]] DEBUG.EXE command]] Traditionally, all computers and operating systems have included a maintenance function, used to determine whether a program is working correctly. DEBUG was originally written by Tim Paterson to serve this purpose in 86-DOS. 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/PC DOS and certain versions of Microsoft Windows. Originally named DEBUG.COM , the executable was renamed into DEBUG.EXE with MS-DOS 3.2. Windows XP 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 editions of Windows. The MS-DOS/PC DOS DEBUG has several limitations: In assembly/disassembly modes it only supports 8086 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 DS:5D to DS:67 (the Program Segment Prefix File Control Block 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, OpenDOS 7.01 and DR-DOS 7.02 and higher, a reimplementation of Digital Research's former Symbolic Instruction Debugger SID/SID86, which came with former versions of DR DOS. 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, 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 facilities with named registers, loaded symbol tables, mathematical operations and base conversions, as well as a commenting disassembler. Some versions also utilized DPMS to function as a "stealth mode" protected-mode debugger. The FreeDOS version of DEBUG was developed by Paul Vojta and is licensed under the MIT License. A 32-bit clone "DEBUGX" version supporting 32-bit 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 [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. 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 files from batch files. go G [=address] [addresses] hex H value1 value2 input I port load L [address] [drive] [firstsector] [number] move M range address name N [pathname] [arglist] output O port byte proceed P [=address] [number] quit Q register R [register] search S range list trace T [=address] [value] unassemble U [range] write W [address] [drive] [firstsector] [number] allocate expanded memory XA [#pages] deallocate expanded memory XD [handle] map expanded memory pages XM [Lpage] [Ppage] [handle] display expanded memory status XS The R command displays the current register status and values AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=2A63 ES=2A63 SS=2A63 CS=2A63 IP=0100 NV UP EI PL NZ NA PO NC 2A63:0100 0F DB 0F While D dumps the current memory displaying both hexadecimal and ASCII values 2A63:0100 0F 00 B9 8A FF F3 AE 47-61 03 1F 8B C3 48 12 B1 .......Ga....H.. 2A63:0110 04 8B C6 F7 0A 0A D0 D3-48 DA 2B D0 34 00 52 2A ........H.+.4.R\* 2A63:0120 00 DB D2 D3 E0 03 F0 8E-DA 8B C7 16 C2 B6 01 16 ................ 2A63:0130 C0 16 F8 8E C2 AC 8A D0-00 00 4E AD 8B C8 46 8A ..........N...F. 2A63:0140 C2 24 FE 3C B0 75 05 AC-F3 AA A0 0A EB 06 3C B2 .$. DEBUG command. ==See also== List of DOS commands DDT (CP/M command) (Dynamic Debugging Technique) SID (Symbolic Instruction Debugger) SYMDEB CodeView Turbo Debugger SoftICE DEBUG (tag) ==References== ==External links== Debug | Microsoft Docs Open source DEBUG implementation that comes with MS-DOS v2.0

Text derived from https://en.wikipedia.org/w/index.php?oldid=1370539064 under CC BY-SA 4.0; modifications have been made.