- Debug (command)
Infobox Software
name = Debug
author =Tim Paterson
developer =Microsoft
operating system =DOS ,MS-DOS ,OS/2 ,Microsoft Windows
genre =Debugger
website = [http://technet.microsoft.com/en-us/library/bb491040.aspx Debug]debug
is a command inDOS ,MS-DOS ,OS/2 andMicrosoft Windows which runs the program debug.exe (or DEBUG.COM in older versions of DOS).cite web| author=Daniel B. Sedory|title=A Guide to DEBUG|accessdate=2007-05-25|url=http://mirror.href.com/thestarman/asm/debug/debug.htm|] Debug can act as an assembler,disassembler , orhex dump program allowing users to interactively examine memory contents (inassembly language ,hexadecimal orASCII ), make changes, and selectively execute COM,EXE and other file types. It also has several subcommands which are used to access specificdisk sector s,I/O port s andmemory address es. MS-DOS Debug runs at a16-bit process level and therefore it is limited to 16-bitcomputer program s.FreeDOS Debug has a "DEBUGX" version supporting32-bit DPMI programs as well.cite web|url=http://japheth.de/Debug/README.TXT|title=FreeDOS DEBUG README|date=|accessdate= 2007-06-25|author=Paul Vojta]Background
Traditionally, all
computers andoperating systems have included a maintenance function, used to determine whether a program is working correctly.Fact|date=June 2007 Debug was written byTim 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. MS-DOS debug has several limitations:* 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 FAT12 format.
* MS-DOS Debug can only accessconventional memory , which is the first 640K in an IBM PC.32-bit Debug clones, such as FreeDOS Debug, have been written.
yntax
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. [cite web|title=Microsoft TechNet Debug article|url=http://technet.microsoft.com/en-us/library/bb491040.aspx|accessdate=2008-04-23] Debug can also be used as a "debug script" interpreter using the following syntax.
debug < FileNameA script file may contain Debug subcommands and assembly language instructions.cite web|title=Using Debug|url=http://kipirvine.com/asm/debug/Debug_Tutorial.pdf|accessdate=2007-06-23] This method can be used to create or edit
binary file s frombatch file s.ee also
*
List of DOS commands
*Edlin is another DOS tool written byTim Paterson .
*SoftICE a modern debugger that inherited its syntax from DebugFact|date=June 2007References
External links
* [http://mirror.href.com/thestarman/asm/debug/debug.htm A Guide to DEBUG]
* [http://www.computerhope.com/debughlp.htm Information about the debug command]
* [http://www.computerhope.com/rdebug.htm Computer Debug Routines / Machine Code]
* [http://help.fdos.org/en/hhstndrd/debug.htm] , [http://japheth.de/Debug/README.TXT] FreeDOS Debug
Wikimedia Foundation. 2010.