





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: COMP ORGAN & ASSEM LANG PROG; Subject: Computer Science; University: University of Alabama - Huntsville; Term: Unknown 1989;
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!






assemble A [address] compare C range address dump D [range] enter E address [list] fill F range list go G [=address] [addresses] hex H value1 value 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] [number] unassemble U [range] write W [address] [drive] [firstsector] [number]
NOTE: Parameters listed in brackets ( [ ] ) are optional. Optional parameters usually indicate there are a number of different ways that a command can be used. I've listed the meanings of all the parameters here for you: address - Memory location specified in hexadecimal. You can use either a simple Offset all by itself (in which case, the present CS 'Code Segment' will be assumed), or you can enter the full Segment:Offset location using either all hex numbers or substituting the
name of a segment register for a number. Leading zeros are not required; thus 1F all by itself would be the location 'CS:001F' ( CS meaning whatever the CS happened to be at the time you entered this ). Examples: 100 DS:12 SS:0 198A: range - Two hexadecimal addresses separated by a single space. They may be listed as either full Segment:Offset pairs or just an Offset alone ( in which case, the Segment is assumed to be that of the present CS or "Code Segment" ). NOTE: Some commands, such as Compare (C), may require that the second address be given only as an offset. list - A string of Hexadecimal bytes separated by a space, or ASCII data enclosed within single or double quote marks. You can list any number of bytes from a single one up whatever number fits on the line before having to press the Enter key. A single byte, such as 00 is most often used with the FILL (f) command whereas an ENTER (e) command will most likely have a string of many hex bytes or ASCII characters per line; for example: e 100 31 C0 B4 09 BA 50 02 CD 21 B8 4C 00 CD 21 e 250 'This is an ASCII data string.$' number - Remember that all numbers and values used in any DEBUG commands are understood as being Hexadecimal only! That includes the number of sectors in the LOAD or WRITE commands and even the number of instructions you want DEBUG to step through in the TRACE or PROCEED commands. It's all HEX all the time in here!
NOTE: In the Examples below, commands which are entered by a user are shown in bold type; data displayed in response by DEBUG is in normal type. DEBUG (from MS- DOS 5.0 or later ) will display the following usage message, if you enter debug /? at a DOS prompt: C:\WINDOWS> debug /? Runs Debug, a program testing and editing tool. DEBUG [[drive:][path]filename [testfile-parameters]] [drive:][path]filename Specifies the file you want to test. testfile-parameters Specifies command-line information required by the file you want to test. Quit: Q Immediately quits (exits) the Debug program! No questions ever asked... should be the first command you remember along with the "? " command.
The bytes at locations 140 through 148 are being compared to those at 340 (through 348, implied ); the bytes are displayed side by side for those which are different (with their exact locations, including the segment, on either side of them). Fill: F range list This command can also be used to clear large areas of Memory as well as filling smaller areas with a continuously repeating phrase or single byte. Examples:
successive 'A' commands (when no address is specified) will always begin at the next address in the chain of assembled instructions. This aspect of the command is similar to the Dump command which remembers the location of its last dump (if no new address is specified). The assembly process will stop after you ENTER an empty line. Example (you enter the characters in bold type):
Unassemble: U [range] Disassembles machine instructions into 8086 Assembly code. Without the optional [range] , it uses Offset 100 as its starting point, disassembles about 32 bytes and then remembers the next byte it should start with if the command is used again. ( The word 'about' was used above, because it may be necessary to finish with an odd-number of bytes greater than 32, depending upon the last type of instruction DEBUG has to disassemble. NOTE: The user must decide whether the bytes that DEBUG disassembles are all 8086 instructions , just data or any of the newer x86 instructions (such as those for the 80286, 80386 on up to the latest CPU from Intel; which are all beyond the ability of DEBUG to understand)! Example:
Input: I port The use of I/O commands while running Windows™9x/Me is just plain unreliable! This is especially true when trying to directly access hard disks! Under Win NT/2000/XP, the I/O commands are only an emulation ; so don't trust them. Though the example below
This command can be used to load files into DEBUG's Memory after you have started the program, but it's main function is to create a new file under control of the Operating System which DEBUG can WRITE data to. Normally, when you want to 'debug' a file, you'd start DEBUG with a command like this: C:\WINDOWS> debug test.com. But it's also possible to load a file into DEBUG's Memory from within DEBUG itself by using the 'N' command and then the 'L' command ( with no parameters ) like this:
debug c:\windows\command\choice.com and then enter an ' r ' at the first DEBUG prompt, DEBUG will display someting similar to this: AX=0000 BX=0000 CX=1437 DX=0000 SP=FFFE BP=0000 SI=0000 DI=
DS=0ED8 ES=0ED8 SS=0ED8 CS=0ED8 IP=0100 NV UP EI PL NZ NA PO NC 0ED8:0100 E90E01 JMP 0211
Flag Name Set Clear Overflow(yes/no) OV NV Direction(increment/decrement) DN UP Interrupt(enable/disable) EI DI Sign(negative/positive) NG PL Zero(yes/no) ZR NZ Auxiliary carry(yes/no) AC NA Parity(even/odd) PE PO Carry(yes/no) CY NC Trace: T [=address] [number] The T command is used to trace (step through) CPU instructions one at a time. If you enter the T command all by itself, it will step through only ONE instruction beginning at the location specified by your CS:IP registers, halt program execution and then display all the CPU registers plus an unassembled version of the next instruction to be executed; this is the 'default' mode of the TRACE command. Say, however, you wanted DEBUG to trace and execute seven instructions beginning at address CS:0205; to do so, you would enter: