Debug command details

Debug plays a very important role in the process of learning assembly and is an extremely important debugging tool, so it is necessary to learn it.

command format Function Description
A [address] Enter assembly instructions
C [range] start address Compares the area specified by "Range" with the same size area specified by "Start Address" and displays the different units
D [scope] Displays the contents of memory cells within the specified range
E Address Byte Value Table Replace the contents of the memory cell starting at "address" with the value in the value table
F Range Byte Value Table fills the memory area with the specified table of byte values
G [=start address][breakpoint address] Execute from the starting point (or current location) and end at the end point
H value 1 value 2 Displays the sum and difference of two hexadecimal values
I port address Input from port
L [address [drive letter sector number of sectors]] read from disk
M range address transfer byte values ​​in "range" to the unit starting at "address"
N file identifier [file identifier...] Specify the filename to prepare for reading/writing the file
O port address byte value output to port
P [=address] [number of instructions] Press the execution process, but do not enter a subroutine call or soft interrupt
Q   Exit DEBUG without saving the file being debugged
R [register name] Display and modify register contents
S Range Byte Value Table Searches the specified table of byte values ​​within the memory area. If found, display the starting address, otherwise, display nothing
T [=address] [number of instructions] Trace execution, execute several instructions from the starting point (or current location)
U [scope] Disassemble, display the assembly instructions corresponding to the machine code
W [address [drive letter sector number of sectors]] Write content to disk, (BX, CX) is the number of bytes written

A few notes about the parameters:

1. Hex: The data entered or displayed in DEBUG are in hexadecimal form

2. Separation: Commands and parameters, parameters and parameters should be separated by spaces, commas or tabs, etc.

3. Address: The address is represented in the form of "segment value: offset", and segment register can also be used to represent "segment value",
such as: 1000:0, ds:10, es:200, cs:30, etc.

4. Range: Indicates the address range, it has two representation modes: "Address 1 Address 2" and "Address 1 Length".
Among them: "Address 1" indicates the starting address, which is expressed by "segment value: offset";
"Address 2" indicates the end address, which is only expressed by "offset";
"Length" is expressed by the letter 'L' number at the beginning.
For example: 100:50 100 - memory area with segment value 100 and offset from 50 to 100;
100:50 L100 - 100-byte area with segment value 100 and offset starting at 50.

5. Port address: two-digit hexadecimal value

6. Byte value: two-digit hexadecimal value

7. Byte value table: It consists of several byte values, or it can be a string enclosed in quotation marks

8. Drive letter: 0—drive A, 1—drive B, 2—drive C, 3—drive D, etc.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324515510&siteId=291194637