DEBUG command Daquan

xiaoxiao2021-03-05  53

Debug

Start Debug, it is a program that can be used to test and debug MS-DOS executable files.

Debug [[DRIVE:] [PATH] FileName [parameters]]]]

parameter

[Drive:] [PATH] FileName

Specifies the location and name of the executable to be tested.

Parameters

Specifies any command line information to be required to be tested.

Description

Use the debug command but not specify the file you want to test

If you use the debug command with no location and file name, type all the debug commands to respond to the Debug prompt, even characters (-).

Debug command

The following is a list of debug commands:

• Display the debug command list.

A assembly 8086/8087/8088 memory code.

c Compare two parts of memory.

D Displays some memory content.

E starts from the specified address to enter the data to memory.

f fills a period of memory using the specified value.

G runs executable in memory.

h Execute a hexadecimal operation.

i displays a 1-byte value from a particular port.

l Add files or disk sector content to memory.

m copy the content in the memory block

/ N is the L or W command specifies the file, or specifies the parameters of the file being tested.

o Sends 1 byte value to the output port.

p Perform a loop, repeated string instruction, software interrupt or subroutine.

q Stop the Debug session.

R Display or change one or more registers.

s Search the mode of one or more byte values ​​in some memory.

t Execute an instruction, then display all the contents of all registers, status of all flags and decoding forms of the instructions to which Debug's next step.

u Absorbed bytes and displays the corresponding original sentences.

w Write the test file to disk.

XA allocates extended memory.

XD release extension memory.

XM map extension memory page.

XS displays the status of the extended memory.

Separation command parameters

All debug commands accept parameters, except for Q commands. You can separate parameters with commas or spaces, but these separators are only needed between two hexadecimal values. Therefore, the following command is equivalent:

DCS: 100 110

D CS: 100 110

D, CS: 100, 110

Specify an effective address item

The address parameter in the debug command specifies the memory location. Address is a two-digit name or a four-bit field address containing the alphanist segment plus an offset. You can ignore segment registers or segment addresses. The default segment of A, G, L, T, U and W command is CS. The default segment of all other commands is DS. All values ​​are all hexadecimal formats.

The valid address is as follows:

CS: 0100

04ba: 0100

There must be a colon between the segment name and the offset.

Specify a valid range item

The RANGE parameter in the debug command specifies the range of memory. Two formats can be selected for Range: start addresses and end addresses, or start addresses and length ranges (represented by L).

For example, both of the following grammar can be specified from the 16-byte range starting from CS: 100:

CS: 100 10F

CS: 100 L 10

Debug subcommand

Select the debug command to get details.

Debug: a (Compilation)

Debug: c (Compare)

Debug: d (dump)

Debug: E (Type)

Debug: f (filled)

Debug: g (steering)

Debug: h (hexadecimal)

Debug: i (input)

Debug: l (loading)

Debug: M (Mobile)

Debug: n (name)

Debug: o (Output) Debug: P (execution)

Debug: q (exit)

Debug: R (Register)

Debug: s (Search)

Debug: t (tracking)

Debug: u (disassembly)

Debug: w (writing)

Debug: XA (Distribute extended memory)

Debug: XD (unassigned extension memory)

Debug: XM (Mapping Extension Inpass Page)

Debug: XS (showing extended memory status)

*********************************************************** ******

Debug: a (Compilation)

Merge 8086/8087/8088 memory code directly to memory.

This command creates executable machine code from the assembly language statement. All values ​​are hexadecimal formats, and these values ​​must be entered one to four characters. Specify the prefix memory code before the referenced operation code (opcode).

a [address]

parameter

Address

Specify the location of the collapse language instruction. Use the hexadecimal value for Address and type each value not ending with the "H" character. If the address is not specified, A will start assembly at its last stop.

For information on inputting data into the specified byte, click Debug E in the "Related Topic" list.

For information on disassembly bytes, click DEBUG U in the "Related Topic" list.

example

A command supports all forms of indirect registration commands, as shown in the following example:

Add BX, 34 [BP 2]. [Si-1]

POP [BP DI]

Push [Si])

Also support all the synonyms synonyms, as shown in the following example:

Loopz 100

Loope 100

Ja 200

JNBE 200

For the 8087 operation code, you must specify a WAIT or FWAIT prefix, as shown in the following example:

Fwait Fadd St, ST (3); this Line Assembles

An fwait prefix

Description

Use memory code

The alternative memory code of the segment is CS:, DS:, ES: and SS:. The memory code returned remotely is RETF. The memory code handled by the string must explicitly declare the string size. For example, using MOVSW can move the 16-bit string, using the MOVSB ​​can move the 8-bit byte string.

Compilation jump and call

The assembler automatically will be short, near and far jump and call compilation to the target address depending on byte replacement. This kind of jump or call can be replaced by using a NEAR or FAR prefix, as shown in the following example:

-A0100: 0500

0100: 0500 JMP 502; A 2-byte Short Jump

0100: 0502 JMP Near 505; a 3-byte ner jump

0100: 0505 JMP FAR 50A; A 5-Byte Far Jump

You can abbreviate the NEAR prefix as NE.

Differentiate and byte memory location

When an operand can reference a word memory location or byte memory location, the data type must be specified with the prefix Word PTR or prefix Byte PTR. Acceptable abbreviations are WO and BY. The following example shows two formats:

DEC WO [Si]

Neg Byte Ptr [128]

Specified operand

DEBUG uses a habitual usage of an operand that includes an operand ([]). This is because on the other hand, DEBUG cannot distinguish the number of operands and memory addresses. The following example shows two formats:

MOV AX, 21; Load Ax with 21hmov AX, [21]; Load Ax with the

CONTENTS OF

Memory Location 21h

Using a pseudo

Use a command to provide two commonly used pseudo-instructions: DB operas, directly compile the byte value to the memory, DW operation code, direct compilation of the word value to memory. The following is an example of two directives:

DB 1, 2, 3, 4, "this is an example"

DB 'this is a quotation mark: "'

DB "this is a quotation mark: '"

DW 1000, 2000, 3000, "BACH"

Debug: c (Compare)

Two parts of memory compare memory.

C Range Address

parameter

Range

Specifies the initiation and end address of the first area to be compared, or the start address and length. For information on valid RANGE values, click "Debug Description" in the "Related Topic" list.

Address

Specifies the start address of the second memory area to be compared. For information on a valid address value, click "Debug Description" in the "Related Topic" list.

example

The following command has the same effect:

C100, 10F 300

C100L10 300

Each command is compared to the memory data block of 100 h to 10FH and the memory data block of 300h to 30FH.

Debug responds to the previous command and displays the following information (assuming DS = 197F):

197F: 0100 4D E4 197F: 0300

197F: 0101 67 99 197F: 0301

197F: 0102 A3 27 197F: 0302

197F: 0103 35 F3 197F: 0303

197F: 0104 97 BD 197F: 0304

197F: 0105 04 35 197F: 0305

197F: 0107 76 71 197F: 0307

197F: 0108 E6 11 197F: 0308

197F: 0109 19 2C 197F: 0309

197F: 010A 80 0A 197F: 030A

197F: 010B 36 7F 197F: 030B

197F: 010C BE 22 197F: 030C

197F: 010D 83 93 197F: 030D

197F: 010e 49 77 197F: 030E

197F: 010F 4F 8A 197F: 030F

Note that the list is missing address 197F: 0106 and 197F: 0306. This indicates that the value in the addresses is the same.

Description

If the Range and Address memory areas are identical, Debug will not display any content directly to the Debug prompt. If there is a difference, Debug will display as follows:

Address1 byte1 byte2 add2

Debug (dump)

Show the content of a certain range of memory addresses.

D [Range]

parameter

Range

Specifies the start and end addresses of the memory area to display their contents, or start addresses and lengths. For information on valid RANGE values, click "Debug Description" in the "Related Topic" list. If the RANGE is not specified, the Debug program will display 128 bytes of content from the end of the address range specified in the previous D command.

For information on displaying register content, click Debug R (Register) in the "Related Topic" list.

example

Assume that types of commands:

DCS: 100 10F

Debug is displayed in the following format: 04BA: 0100 54 4F 4D 00 53 41 57 59-45 52 00 00 00 00 00 Tom.SAWYER ......

If you type a D command without parameters, DEBUG arrays the display format as described in the previous example. Each line shown is at the beginning of the address that is more than 16 bytes than the previous line (if it is a screen displayed on the 40 column, it is 8 bytes).

For each non-parameter D command that is backed, Debug will display byte content immediately after the last display command.

If you type the following command, Debug will start displaying the contents of 20h bytes from CS: 100:

DCS: 100 L 20

If you type the following command, Debug will display all bytes from the CS section of 100H to 115H:

DCS: 100 115

Description

When using the D command, Debug displays memory content in two parts: hex part (the value of each byte is expressed in hexadecimal format) and ASCII code part (using ASCII for each byte) Code character is represented. Each non-printing character is represented by the session (.) In the displayed ASCII section. Each display line displays a 16-byte content, and there is a hyphen between the 8th byte and the 9th byte. Each display line starts from the 16-byte boundary.

Debug: E (Type)

Enter the data into the address specified in the memory.

You can type data in hexadecimal or ASCII format. Any data stored before the specified location was previously lost.

e address [list]

parameter

Address

Specifies the first memory location of the input data.

List

Specifies the data to enter the continuous byte of the memory.

For information on integrated memory code, click Debug A in the "Related Topic" list.

For information on displaying some contents of the memory, click Debug D in the "Related Topic" list.

example

Assume that types of commands:

ECS: 100

Debug Displays the first byte according to the format below:

04BA: 0100 EB.

To change this value to 41, type 41 in the insertion point, as shown below:

04BA: 0100 EB.41_

You can type a continuous byte value with an E command. Press the spacebar after typing the new value instead of pressing the Enter. DEBUG displays the next value. In this example, if the SpaceBar (Spacebar) is pressed three times, Debug will display the value below:

04BA: 0100 EB.41 10. 00. BC._

To change the hexadecimal value BC to 42, type 42 in the insert point, as shown below:

04BA: 0100 EB.41 10. 00. BC.42_

It is assumed that the determined value 10 should be 6F. To correct this value, press the HYPHEN button twice to return to address 0101 (value 10). Debug Shows the following:

04BA: 0100 EB.41 10. 00. BC.42-

04ba: 0102 00.-

04ba: 0101 10._

Type 6F to change the value in the insert point, as shown below:

04BA: 0101 10.6F_

Press ENTER to stop the E command and return it to the Debug prompt.

The following is an example of a string item:

EDS: 100 "this is the text esample"

This string will populate 24 bytes from DS: 100.

instructions

Use address parameters

If the value of address is specified without specifying the value of an optional list parameter, Debug will display the address and content, repeat the address in the next row, and wait for your input. At this point, you can do one of the following:

· Replace the byte value. To do this, type a new value after the current value. If the value you typed is not a valid hexadecimal value, or the value contains more than two numbers, Debug will not return invalid or extra characters.

· Go to the next byte. To do this, press the SpaceBar (Spacebar). To change the value in this byte, type a new value after the current value. If you press the SpaceBar (Spacebar), the movement exceeds 8-bit boundaries, and the debug program will display a new row and display the new address at the head.

· Return to the previous byte. To do this, press the HYPHEN button (-). You can repeatedly move more bytes backhand. When pressing Hyphen, Debug starts a new row and displays the current address and byte value.

· Stop execution E command. To do this, press ENTER. You can press Enter in any byte position.

Use list parameters

If the value of the list parameter is specified, the subsequent E command will replace the existing byte value in the list in the list. If an error occurs, you will not change any byte value.

The List value can be a hexadecimal byte or string. Use spaces, commas, or tabs to divide the value. A string must be included in a single or double quotation mark.

Debug: f (filled)

Fill the address in the specified memory area with the specified value.

You can specify the data represented by the hexadecimal or ASCII format. Any data stored in the specified location will be lost.

f Range List

parameter

Range

Specifies the start and end addresses to populate the memory area, or start addresses and lengths. For information on effective Range values, click "Debug Description" in the "Related Topic" list.

List

Specifies the data to be entered. The List can consist of a string including hexadecimal or quotation marks.

example

Assume that types of commands:

F04BA: 100L100 42 45 52 54 41

In response, DEBUG fills the memory location from 04ba: 100 to 04ba: 1F using the specified value. DEBUG repeats these five values ​​until 100H bytes all filled.

Description

Use the RANGE parameter

If the Range contains the number of bytes than the value in the List, Debug will repeat the value in the list until all bytes in Ran are filled.

If any memory is corrupted or absent in Range, Debug will display an error message and stop the F command.

Use list parameters

If the value is more than the number of bytes in the range, Debug will ignore additional values ​​in the list.

Debug: g (steering)

Run the program in memory.

g [= address] [BREAKPOINTS]

parameter

= Address

Specifies the program address to start executing in memory. If you do not specify address, Windows 2000 will start the program from the current address in the CS: IP register.

Breakpoints

Specifies 1 to 10 temporary breakpoints that can be set to the part of the g command.

For information on executing loops, repetition string instructions, software interrupts, or subroutions, click Debug P (execution) in the "Related Topic" list.

For information on executing instructions, click Debug T (Track) in the "Related Topic" list.

example

Assume that type: GCS: 7550

Windows 2000 runs the program in the current memory until it is executed to the breakpoint address 7550 in the CS segment. Debug will display the status of the contents and flags of the register and end the g command.

The following command sets two breakpoints:

GCS: 7550, CS: 8000

If you type a g command again after DEBUG, you will be executed from the instruction after the breakpoint, not the usual start address.

Description

Use address parameters

The aliquot (=) must be used to distinguish the start address and breakpoint address before the Address parameter.

Specified breakpoint

The program stops at the first breakpoint it encounters, regardless of what location button in the BreakPoint list. DEBUG replaces the original instruction with interrupt code at each breakpoint.

When the program reaches the breakpoint, DEBUG restores all breakpoint addresses to their initial instructions and displays the contents of all registers, states of all tags, and decoding forms of the final execution instruction. The information displayed by DEBUG is the same as the information displayed when using the Debug R command and specifies the breakpoint.

If the program is not stopped at the breakpoint, the Debug program will not replace the interrupt code using the original instruction.

Set the limit of breakpoints

The breakpoint can be set on the address of the first byte containing the 8086 operation code (opcode). If more than 10 breakpoints are set, Debug will display the following information:

BP Error

Requirements for user stack pointers

The user stack pointer must be valid and must have 6 bytes available for g commands. This command jumps to the program being tested using the IRET instruction. Debug Sets the user stack pointer and presses the user flag, the code segment register, and the instruction pointer into the user stack. (If the user stack is invalid or too small, the operating system may fail.) DEBUG sets the interrupt code (0cch) at the specified breakpoint.

Restart the program

Don't try to restart the program after Windows 2000 is displayed;

Program terminated normally

To run the program correctly, you must reload the program by using the debug n (name) and the L (load) command.

Debug: h (hexadecimal)

Perform a hexadecimal operation for the designated parameters.

h value1 value2

parameter

Value1

Represents any hexadecimal numbers from 0 to FFFFH.

Value2

Represents the second hexadecimal number from 0 to FFFFH.

example

Assume that types of commands:

H19F 10A

DEBUG performs an operation and display the following results.

02A9 0095

Description

Debug first adds the specified two parameters and subtract the second parameter from the first parameter. The results of these calculations are displayed in one line: first calculate and then calculate the difference.

Debug: i (input)

Read and display one byte value from the specified port.

i Port

parameter

port

Specify the input port by address. The address can be a 16-bit value.

For information on sending the byte value to the output port, click Debug O (Output) in the "Related Topic" list.

example

Assume that types of commands:

I2F8

At the same time, it is assumed that the byte value of the port is 42h. Debug reads this byte and displays its value as follows:

42

Debug: l (loading)

The contents of a file or a specific disk sector are added to memory.

To load BX from disk file: The number of bytes specified in the CX register, use the following syntax: L [address]

To skip the Windows 2000 file system and load a specific sector directly, use the following syntax:

l Address Drive Start Number

parameter

Address

Specifies the memory location to load the file or sector content. If address is not specified, Debug will use the current address in the CS register.

Drive

Specifies the drive that contains a disk that reads the specified sector. This value is numeric: 0 = a, 1 = b, 2 = C, etc.

Start

Specifies the number of hexadecimal numbers for the first sector to load their content.

Number

Specifies the number of hexadecimal numbers for continuous sectors to load their content. DRIVE, START, and Number parameters can only be used if the contents to load specific sectors rather than load the DEBUG command line or the recent DEBUG N (Name) command.

For information on the file specified for the L command, click Debug N in the "Related Topic" list.

For information about writing a file that is debugged to disk, click Debug W (Write) in the "Related Topic" list.

example

Assume Debug and type the following command:

Nfile.com

You can now type the L command to load file.com. Debug will load the file and display the Debug prompt.

It is assumed that the contents of the 109 (6DH) sector of the start logic sector to be 15 (0FH) are required to be loaded into the memory of 04ba: 0100. To do this, type the following command:

L04BA: 100 2 0F 6D

note

Use L commands without parameters

When using the L command without parameters, the file specified on the debug command line will be loaded into the memory, starting from the address CS: 100. DEBUG simultaneously sets the BX and CX registers to loaded bytes. If the file is not specified in the debug command line, the filed file will be the file that is recently specified by n commands.

1 command with the Address parameter

If you use the L command with the Address parameter, Debug will start loading a file or specifying the content of the sector from the memory location address.

L command with all parameters

If you use the L command with all parameters, Debug will load the contents of the specified disk sector instead of loading a file.

Load the content of a particular sector

Each sector within the specified range is read from Drive. DEBUG is loaded from Start until the content in the sector number specified in Number is loaded.

Load .exe file

DEBUG ignores the address address parameter of the .exe file. If specified .exe file, Debug repositions the file to the load address specified in the .exe file. Before the .exe file is loaded into memory, the title itself is detached from .exe file, so the .exe file size is different from memory. If you want to check the entire .exe file, use a different extension name to name the file.

Open hexadecimal files

Debug will have a file with the .hex extension to think that the hexadecimal format file. Type an L command without parameters, you can load the hex file starting from the address specified in the hexadecimal file. If the Type L command contains the address parameter, the debug will add the specified address to the address found in the hex file to determine the start address.

Debug: M (Mobile)

Copy the contents of a memory block to another memory block.

M Range Address

parameter

Range

Specifies the start and end addresses of the memory area to copy the content, or the start address and length. Address

Specifies the starting address to copy the Range content to that location.

example

Assume that types of commands:

MCS: 100 110 CS: 500

DEBUG first copies the contents of the CS: 110 address to the address CS: 510, then copy the contents of the CS: 10f address to the CS: 50F, and then copy the contents of the CS: 100 address to the address CS: 500. To view the results, use the debug d command and specify the destination address using the m command.

Description

The impact of replication operation on existing data

If the new data is not written to the address in the data block being copied, the source data will remain unchanged. However, if the target block already contains data (just like it is in a copy of the copy), the data will be overwritten. (Overlay copy operation refers to the operation of the contents of those target data blocks overlay the content of the original data block.)

Perform overlay copy operation

m Command Perform the override copy of the target address without losing the data. The content of the rewritten address is first copied. Therefore, if the data of the higher level address is copied to a lower bit address, the copy operation starts from the minimum bit address of the original block and to the highest bit address. Conversely, if you want to copy data from the low address to the high address, the replication operation starts from the highest address of the original block, and the lowest address is performed.

Debug: n (name)

Specifies the name of the executable of the Debug L or W (Write) command, or specifies the parameters of the executable of the executable being debugged.

n [drive:] [path] filename

To specify the parameters of the executable of the test, use the following syntax:

n file-parameters

parameter

If it is used without parameters, the n command clears the current specification.

[Drive:] [PATH] FileName

Specifies the location and name of the executable to be tested.

FILE-Parameters

Specify parameters and switches for executables being tested.

For information on the contents of the content or specified disk sector, click Debug L in the "Related Topic" list.

For information about writing a file that is debugged to disk, click Debug W (Write) in the "Related Topic" list.

example

Assuming that Debug has been launched and the program pROG.COM that is debugging is loaded. Then you decide to specify two parameters for prog.com and run this program. Here is the command sequence of this example:

Debug prog.com

NPARAM1 PARAM2

G

In this case, the Debug G (steering) command runs the program, as if you have typed the following command after the Windows 2000 command prompt:

PROG param1 param2

Therefore, testing and commissioning reflects the typical runtime environment of prog.com.

In the following command sequence, the first n command specifies the file1.exe as a file of the subsequent L (load) command, which loads file1.exe to memory. The second n command specifies the parameters that file1.exe will use. Finally, the g command will run the file1.exe file, as if you type File1 file2.dat file2.dat in the Windows 2000 command line.

Nfile1.exe

l

Nfile2.dat file3.dat

G

note

• Do not use the L command after the second form of the n command. Also note that if you now use the W (write) command, Windows 2000 saves the file file1.exe that is debugging using the name file2.dat. To avoid this result, the first form of n command should always be used immediately before the L or W command.

Description

Two uses of n commands

You can use n command in two ways. First, you can use it to specify the file used by the L (Load) or W (Write) command. If you start Debug without nameting the debugged file, you must use the command NFileName before using the l command to load files. In CS: 5c, the file control block (FCB) is correctly arranged in the format of the file name. Second, you can use the n command to specify the command line parameters and switches of the debug file.

Memory area

The following four memory areas are affected by n commands:

Memory location content

CS: 5C file 1 file control data block (FCB)

CS: 6C file 2 file control data block (FCB)

CS: 80 n Command line length (represented by character)

CS: 81 n command line characters

The first file name specified for the n command is placed in the FCB of CS: 5C. If the second file name is specified, this name will be placed in the FCB of CS: 6C. The number of characters typed on the n command line (other than the first character, n) is stored at position CS: 80. The actual character on the N command line (again, except for the letter N) is stored in the position starting with CS: 81. Note that these characters may be any switches and separators that are valid in the commands typed in the Windows 2000 command prompt.

Debug: o (Output)

Send the byte value to the output port.

o Port Byte-Value

parameter

port

Use the address to specify the output port. The port address can be 16-bit values.

BYTE-VALUE

Specifies the byte value to point to Port.

For information on reading bytes from the input port, click Debug I in the "Related Topic" list.

example

To send the byte value 4FH to an output port of 2F8H, type the following command:

O2F8 4F

Debug: p (execution)

Perform cyclic, repeated string instructions, software interrupts or subroutines; or track by any other instructions.

p [= address] [Number]

parameter

= Address

Specifies the first position to perform the instruction. If the address is not specified, the default address is the current address specified in the CS: IP register.

Number

Specifies the number of instructions to be executed before returning control to Debug. The default is 1.

For information on running programs in memory, click Debug G in the "Related Topic" list.

For information on executing instructions, click Debug T (Track) in the "Related Topic" list.

example

Assume that the program being tested is included in the address CS: 143F. To run the slam of the Call target, then return the control to Debug, type the following command:

P = 143F

Debug Display Results in the following format:

AX = 0000 bx = 0000 cx = 0000 DX = 0000 sp = ffee bp = 0000 Si = 0000 di = 0000

DS = 2246 ES = 2246 SS = 2246 CS = 2246 IP = 1443 NV Up EI PL NZ AC PO NC2246: 1442 7505 JNZ 144A

Description

Transfer control to the program to be tested

When the P command transmits the control from DEBUG to the program to be tested, the program is unbroken, until the cycle, repeat the string instruction, the software interrupt, or complete the subroutine of the specified address, or until the specified number of machines Sailing instruction. Control returns to Debug.

Restriction of address parameters

If the address parameter does not have a specified segment, Debug will use the CS register of the test program. If address is omitted, the program will start from the address specified by the CS: IP register. The equal sign (=) must be used before the Address parameter to distinguish it with the Number parameter. If the instruction at the specified address is not a loop, repeated string command, software interrupt or subroutine, the P command is the same as the DEBUG T (Track) command.

Use the message displayed using the P command

When the P executes a paragraph, DEBUG displays the register content of the program, the status of the flag, and the decoding form of the next paragraph will be executed.

caveat

· You cannot use the P command to track read-only memory (ROM).

Debug: q (exit)

Stop Debug sessions and do not save the currently test file.

When you type q, control returns to the command prompt of Windows 2000.

Qi

parameter

This command does not with parameters.

For information on saving files, click Debug W (Write) in the Related Topic list.

Debug: R (Register)

Display or change the content of one or more CPU registers.

R [register-name]

parameter

no

If used without parameters, the r command displays the contents of all registers and the flags in the register storage area.

Register-name

Specifies the register name to display its content.

For information on displaying some contents of the memory, click Debug D in the "Related Topic" list.

For information on disassembly bytes, click DEBUG U in the "Related Topic" list.

example

To see the contents of all registers, all tag status and instruction decoding tables for the current location, type the following command:

r

If the current location is CS: 11A, the display appearance will be similar to the following:

AX = 0e00 bx = 00ff CX = 0007 DX = 01ff sp = 039d bp = 0000 Si = 005c di = 0000

DS = 04BA ES = 04BA SS = 04BA CS = O4BA IP = 011A NV UP DI NG NZ AC PE NC

04BA: 011A CD21 INT 21

To view the status of the flag, type the following command:

RF

DEBUG Displays information in the following format:

NV UP DI NG NZ AC PE NC - _ _ _ _ _

Now you can type one or more valid flag values ​​in any order, where there is or no spaces, as shown below:

NV UP DI NG NZ AC PE NC - Pleicy

Debug ends the R command and displays the Debug prompt. To view your changes, type R or RF commands. Debug will display the following:

NV UP EI PL NZ AC PE CY - _ _ _ _ _ _

Press ENTER to return to the Debug prompt.

Description

Use the R command

If the register name is specified, Windows 2000 will display the 16-bit value of the register indicated by hexadecimal tag and display the colon as a prompt. If you want to change the value contained in the register, unless you type a new value and press Enter; otherwise, press ENTER to return to the debug prompt.

Effective register name

The following is the valid value of Register-Name: AX, BX, CX, DX, SP, BP, Si, Di, DS, ES, SS, CS, IP, PC, and F. Both IP and PC reference instruction pointers.

If the register name is specified instead of specifying from the previous list, Windows 2000 will display the following message:

Br Error

Using F characters instead of register name

If you type the F character instead of the register name, Debug is displayed as a two-alphabet code, and then displays the Debug prompt. To change the settings of the logo, type the appropriate two-letter code from the following table:

Sign name setting clearance

Overflow OV NV

Direction DN (reduced) UP (increase)

Interrupt EI (Enabled) DI (Disabled)

Positive negative Ng (negative) PL (positive)

Zero ZR NZ

Assisted in AC NA

Parity PE (even check) PO (校)

Give CY NC

You can type a new logo value in any order. There is no need to leave space between these values. To stop the R command, press ENTER. Any logo that does not specify a new value remains the same.

Mail displayed with the R command

If multiple values ​​are specified for tag, Debug will display the following message:

DF Error

If you specify the flag code not listed in the previous table, Debug will display the following message:

BF error

In both cases, DEBUG will ignore all settings specified after invalid items.

Debug's default setting

When starting debug, the segment register is set to the low end of idle memory, and the instruction pointer is set to 0100h, clear all the flags, and set the remaining registers to zero, except for the SP set to FFEEH.

Debug: s (Search)

Search the mode of one or more byte values ​​in an address range.

S Range List

parameter

Range

Specifies the beginning and end address to search for the range. For information on Range parameter valid values, click Debug in the "Related Topic" list.

List

Specify the mode of one or more bytes, or the string to search. Separate each byte value and the next byte value with a space or comma. The string value is included in the quotation mark.

example

It is assumed that you need to find all the addresses containing the value 41 and range from CS: 100 to CS: 110. To do this, type the following command:

SCS: 100 110 41

Debug Display Results in the following format:

04ba: 0104

04ba: 010d

-

The following command searches the string "pH" in the range of CS: 100 to CS: 1A0.

SCS: 100 1A0 "PH"

Description

If the List parameter contains multiple byte values, Debug will only display the first address of the parameter value. If the List contains only one byte value, Debug will display all the addresses that appear in the specified range.

Debug: t (tracking)

Execute an instruction and display all registered content, status of all flags, and decoding form of the executed instruction. T [= address] [Number]

parameter

= Address

Specifies the address of the Debug starts the tracking instruction. If the Address parameters are omitted, track the address specified from the program's CS: IP register. For information on the active values ​​of the Address parameter, click Debug in the "Related Topic" list.

Number

Specifies the number of instructions to track. This value must be a hexadecimal number. The default is 1.

For information on executing loops, repetitive string instructions, software interrupts or subroutines, click Debug P in the "Related Topic" list.

For information on executing the program in the current memory, click Debug G in the "Related Topic" list.

example

To perform an instruction (CS: IP pointing command), then display the contents of the register, the status of the flag, and the decoding form of the instruction, type the following command:

t

If the instructions in the program are located in 04BA: 011A, Debug may display the following information:

AX = 0e00 bx = 00ff CX = 0007 DX = 01ff sp = 039d bp = 0000 Si = 005c di = 0000

DS = 04BA ES = 04BA SS = 04BA CS = O4BA IP = 011A NV UP DI NG NZ AC PE NC

04BA: 011A CD21 INT 21

Description

Track the instructions in read-only memory

T command uses the hardware tracking mode of the 8086 or 8088 microprocessor. Therefore, instructions stored in read-only memory (ROM) can also be tracked.

Use address parameters

The equal sign (=) must be used before the Address parameter to distinguish it with the Number parameter.

Debug: u (disassembly)

Absorbed bytes and displays the corresponding original sentences, including address and byte values. The disassembly code looks like a list of assembled files.

U [Range]

parameter

no

If you use without parameters, the u command decomposes the 20H byte (default), starting from the first address after the address displayed by the previous U command.

Range

Specifies the start address and end address to which you want to disassemble the code, or start addresses and lengths. For information on Range parameter valid values, click Debug in the "Related Topic" list.

For information on integrated memory code, click Debug A in the "Related Topic" list.

For information on displaying some contents of the memory, click Debug D in the "Related Topic" list.

example

To disassemble 16 (10h) bytes, start from address 04ba: 0100, type the following command:

U04BA: 100L10

Debug Display Results in the following format:

04BA: 0100 206472 and [Si 72], AH

04BA: 0103 69 DB 69

04BA: 0104 7665 JBE 016B

04BA: 0106 207370 and [BP DI 70], DH

04BA: 0109 65 DB 65

04BA: 010A 63 DB 63

04BA: 010B 69 DB 69

04BA: 010C 66 DB 66

04BA: 010D 69 DB 69

04ba: 010e 63 DB 63

04BA: 010F 61 DB 61

If you only display information from 04BA: 0100 to 04BA: 0108 Specific address, type the following command: U04BA: 0100 0108

Debug Shows the following:

04BA: 0100 206472 and [Si 72], AH

04BA: 0103 69 DB 69

04BA: 0104 7665 JBE 016B

04BA: 0106 207370 and [BP DI 70], DH

Debug: w (writing)

Write files or specific partitions to disk.

To write a disk file in the BX: CX register, you want to write a disk file, use the following syntax:

w [address]

To skip the Windows 2000 file system and write to a specific sector, use the following syntax:

W Address Drive Start Number

parameter

Address

Specifies the start memory address to be written to the file or some files of the disk file. If Address is not specified, the debug program will start from CS: 100. For information on the acts parameter valid value, click Debug in the "Related Topic" list.

Drive

Specifies the drive that contains the target disk. This value is numeric: 0 = a, 1 = B, 2 = C, and so on.

Start

Specifies the hexadecimal number to write to the first sector.

Number

Specifies the number of sectors to be written.

For information on specifying files for W command, click Debug N (Name) in the "Related Topic" list.

For information on memory or file sector content, click Debug L in the "Related Topic" list.

example

It is assumed that the starting address is written to the disk of the CS: 100 to the disk of the drive B. The data is required to start from the logical sector number 37h of the disk and last 2BH sectors. To do this, type the following command:

WCS: 100 1 37 2B

When the write operation is completed, the debug is again displaying the Debug prompt.

Description

The name of the disk file must be specified when Debug is started or in the nearest Debug N command. Both methods can correctly arrange the file name of the address CS: 5c file control block.

Reset BX: CX before using the W command without parameters

If DEBUG G (steering), T (Track), P (Execute) or R (Register) command must be used before using the non-parametric W command, reset the BX: CX register.

Write the modified file to disk

If the file is modified but does not change the file name, length, or the start address, Debug still writes the file to the source disk location correctly.

w command limit

You cannot write .exe or .hex file with this command.

caveat

· Because it is slightly WINDOWS 2000 file handle, it is very dangerous to write a specific partition. If you type an error, the disk file structure is easily damaged.

Debug: XA (Distribute extended memory)

Assign the number of specified page numbers for extended memory.

To use extended memory, you must install an extended memory device driver that matches 4.0 of the Lotus / Intel / Microsoft Extended Memory Specification (LIM EMS).

XA [count]

parameter

count

Specifies the number of 16KB pages to the extended memory to be assigned.

For information on other debug commands that use extended memory, click the XD (release extended memory) in the "Related Topic" list, XM (map extension memory page) or XS (display extended memory status).

example

To assign 8 pages of extended memory, type the following command:

xa8

If the command is successful, Debug will display similar to the following message:

Handle Created = 0003

Description

If the specified page number is available, Debug will display a message, which indicates the hexadecimal number of the handle of the handle; otherwise, Debug will display an error message.

Debug: XD (Release Extension Memory)

Release the handle to the extended memory.

To use extended memory, you must install an extended memory device driver that matches 4.0 of the Lotus / Intel / Microsoft Extended Memory Specification (LIM EMS).

XD [handle]

parameter

Handle

Specifies the handle to be released.

For information on other debug commands that use extended memory, click XA (Assign Extension Memory), XM (Map Extension Inclusive) or XS (Display Extension Memory).

example

To release the handle 0003, type the following command:

XD 0003

If the command is successful, Debug will display the following message:

Handle 0003 deallocated

Debug: XM (Mapping Extension Inpass Page)

The extended memory logic page belonging to the specified handle is mapped to the physical page of the extended memory.

To use extended memory, you must install an extended memory device driver that matches 4.0 of the Lotus / Intel / Microsoft Extended Memory Specification (LIM EMS).

XM [LPAGE] [PPAGE] [handle]

parameter

LPage

Specifies the logical page number to map to the physical page PPAGE.

PPAGE

Specifies the physical page number that maps LPAGE.

Handle

Specify the handle.

For information on other debug commands that use extended memory, click XA (Assign Extension Memory), XD (Release Extension), or XS (Display Extension).

example

To map the logic page 5 of the handle 0003 to the physical page 2, type the following command:

XM 5 2 0003

If the command is successful, Debug will display the following message:

Logical Page 05 mapped to physical page 02

Debug: XS (showing extended memory status)

Displays information about extending memory status.

To use extended memory, you must install an extended memory device driver that matches 4.0 of the Lotus / Intel / Microsoft Extended Memory Specification (LIM EMS).

XS

parameter

This command does not with parameters.

For information on other debug commands using extended memory, click XA (Assign Extension Memory), XD (Release Extension), or XM (Map Extended Memory Page) in the "Related Topic" list.

example

To display an extended memory message, type the following command:

XS

DEBUG shows information similar to the following:

Handle 0000 HAS 0000 Pages AllocatedHandle 0001 HAS 0002 PAGES Allocated

Physical Page 00 = Frame Segment C000

Physical Page 01 = Frame Segment C400

Physical Page 02 = Frame Segment C800

Physical Page 03 = Frame Segment CC00

2 of a Total 80 EMS Pages Have Been Allocated

2 of a total ff EMS Handles Have Been Allocated

Description

The information displayed by Debug has the following format:

Handle XX HAS XX Pages Allocated

Physical Page XX = Frame Segment XX

XX of a Total XX EMS Pages Have Been Allocated

XX of a Total XX EMS HANDLES HAVE BEEN Allocated

********************** DEBUG sub-command finger ********************** *******

转载请注明原文地址:https://www.9cbs.com/read-36672.html

New Post(0)