AD

Analysis and examples using the DEBUG command Daquan

Debug
Start Debug, it can be used to test and debug MS-DOS executable file.
Debug [[drive:] [path] filename [parameters]]
Parameters [drive:] [path] filename
To test the executable file specified location and name.
parameters
To test the executable file specified any required command-line information.
+ +
Instructions to use the Debug command without specifying a file to test if there is no location and file name of the Debug command, then type all the Debug command in response to the Debug prompt, hyphen (-).
Debug Commands Debug Commands The following is a list:
? To display the Debug command list.
a compilation of 8086/8087/8088 memory code.
c compare the two parts of memory.
d displays the contents of some memory.
e starting from the specified address, enter the data into memory.
f fill a memory with the specified value.
g run the executable file in memory.
h perform hex arithmetic.
i shows from a specific port 1-byte value.
l contents of a file or disk sector into memory.
m copy the contents of the memory block / n l or w command to the specified file, or specify the parameters of the file being tested.
o to the output port to send a byte value.
p the loop, repeated string instruction, software interrupt or subroutine.
q Stop Debug Session.
r display or change one or more registers.
s part of the memory in one or more bytes in the value of the search pattern.
t execute a command, then displays the contents of all registers, all the signs of the state and the Debug command to be executed next decoding form.
u disassemble the bytes and display the corresponding original statement.
w write the file to disk will be tested.
xa allocate extended memory.
xd release of extended memory.
xm extension of the mapping memory pages.
xs display expanded memory status.
Debug commands separated by command parameters are acceptable for all parameters, except q command outside. Can use comma or space separated parameters, but only between the two hexadecimal values ​​only need the separator. Therefore, the following commands are equivalent:
dcs: 100110
dcs: 100110
d, cs: 100,110
Debug command specifying a valid address entry in the address parameter specifies the memory location. Address is a segment that contains records of two letters the name or address of a four field with an offset. Can ignore the segment registers or segment address. a, g, l, t, u and w commands default segment is CS. All other commands default segment is DS. All values ​​are in hexadecimal format.
Effective the following address:
CS: 0100
04BA: 0100
In a section name and the offset between the need colon.
Debug command to specify a valid range of items in the range parameter specifies the memory range. You can choose between two formats for the range: start address and end address, or a starting address and length (denoted by l).
For example, the following two syntax can be specified from the CS: 100 byte range starting 16:
cs: 10010f
cs: 100l10
+ +
Debug subcommands select Debug command for more information.
Debug: A (assembly)
Debug: C (more)
Debug (dump)
Debug: E (type)
Debug: F (fill)
Debug: G (steering)
Debug: H (Hex)
Debug: I (input)
Debug: L (Load)
Debug: M (mobile)
Debug: N (name)
Debug: O (output)
Debug: P (execution)
Debug: Q (quit)
Debug: r (register)
Debug: s (search)
Debug: T (track)
Debug: U (Disassembly)
Debug: W (write)
Debug: XA (extended memory allocation)
Debug: XD (unassign extended memory)
Debug: XM (extended memory map page)
Debug: XS (extended memory status display)
*********************** Debug subcommands ************************ ******
Debug: A (assembly)
8086/8087/8088 mnemonics directly into memory.
The command statement from the assembly language to create executable machine code. All values ​​are in hexadecimal format, must be one to four characters enter these values. In reference to the operation code (opcode) before the specified prefix mnemonics.
a [address]
Parameter address
Specify the location, type of assembly language instructions. Use the hex value of the address, and type is not an "h" character at the end of each value. If you do not specify the address, a last stop in the office began to compile it.
For entering data into the specified byte of information, please click the "Related Topics" list DebugE (type).
Bytes of information about disassembly, please click the "Related Topics" list DebugU (disassembly).
Example a command supports all forms of indirect registration command, the following example:
addbx, 34 [bp +2]. [si-1]
pop [bp + di]
push [si])
Also supports all opcode synonyms, the following example:
loopz100
loope100
ja200
jnbe200
For the 8087 operation code, you must specify wait or fwait prefix, the following example:
fwaitfaddst, st (3); thislineassembles
; Anfwaitprefix
Memory code segment shows an alternative to using the memory code cs:, ds:, es: and ss:. Remote code is return the memory retf. String handling code must explicitly declare the memory size of the string. For example, the use of movsw can move 16-bit string, using the mov *** (for some reason the text is the text for some reason the system is shielded )***( shield system) can be moved octet string.
Assembler assembly jumps and calls will be automatically replaced based on byte short, near and far jumps and calls the assembly to the target address. By using the prefix can be near or far jump or call to replace this, the following example:
-A0100: 0500
0100:0500 jmp502; a2-byteshortjump
0100:0502 jmpnear505; a3-bytenearjump
0100:0505 jmpfar50a; a5-bytefarjump
Near the prefix can be abbreviated as ne.
Distinction between word and byte memory location when a word operand can refer to a byte memory location or memory location, you must use a prefix or a prefix byteptr wordptr specify the data type. Acceptable abbreviations are wo and by. The following example shows two formats:
decwo [si]
negbyteptr [128]
Debug using the specified operands included in brackets ([]) referenced memory operand address idiom. This is because the other hand Debug can not distinguish between an immediate operand and the operand memory address. The following example shows two formats:
movax, 21; loadAXwith21h
movax, [21]; loadAXwiththe
; Contentsof
; Memorylocation21h
Using directive to use a command with two commonly used directives: db operation code, the compilation of byte values ​​directly into memory, dw opcode, the value of the word directly compiled into memory. The following is an example of two directives:
db1, 2,3,4, \ "THISISANEXAMPLE \"
dbTHISISAQUOTATIONMARK: \ "
db \ "THISISAQUOTATIONMARK: \"
dw1000, 2000,3000, \ "BACH \"
Debug: C (more)
Comparing the two parts of memory.
crangeaddress
Parameter range
Specify the first to compare the memory area starting and ending addresses, or the starting address and length. The range of valid values, click the "Related Topics" list in the "Debug instructions."
address
Designated to compare the second memory area start address. Value of the effective address, click the "Related Topics" list in the "Debug instructions."
+ +
Examples The following command has the same effect:
c100, 10f300
c100l10300
Each command of 100h to 10Fh 300h memory block and memory block to 30Fh comparison.
Debug response to the previous command and displays the following information (assuming DS = 197F):
197F: 01004DE4197F: 0300
197F: 01016799197F: 0301
197F: 0102A327197F: 0302
197F: 010335F3197F: 0303
197F: 010497BD197F: 0304
197F: 01050435197F: 0305
197F: 01077671197F: 0307
197F: 0108E611197F: 0308
197F: 0109192C197F: 0309
197F: 010A800A197F: 030A
197F: 010B367F197F: 030B
197F: 010CBE22197F: 030C
197F: 010D8393197F: 030D
197F: 010E4977197F: 030E
197F: 010F4F8A197F: 030F
Note that the list of missing address 197F: 0106 and 197F: 0306. This indicates that the value of those addresses are the same.
+ +
If the memory address range and shows the same region, Debug will not show anything directly returned to the Debug prompt. If there are differences, Debug will display the following format:
address1byte1byte2addess2
+ + + +
Debug (dump)
Display the contents of a range of memory addresses.
d [range]
Parameter range
To display the contents of the specified memory area of ​​the starting and ending addresses, or the starting address and length. The range of valid values, click the "Related Topics" list in the "Debug instructions." If you do not specify the range, Debug the program from the previous d command in the specified address range starting at the end display 128 bytes of content.
Display the contents of the register, please click the "Related Topics" list DebugR (register).
+ +
Type the following command example assumes that:
dcs: 10010f
Debug the following format in the range of content:
04BA: 0100544F4D0053415759-4552000000000000TOM.SAWYER ......
If the case without argument type d command, Debug described by previous example shows the contents of presentation format. Each line shows the address of the previous line of 16 bytes large (if the screen display 40, or 8 bytes) of the address at the beginning.
For each type behind the d command with no arguments, Debug will display the command immediately after the last byte of content displayed immediately.
If you type the following command, Debug from the CS: 100 started to show the contents of 20h bytes:
dcs: 100l20
If you type the following command, Debug displays the range from 100h to 115h CS segment of the contents of all the bytes:
dcs: 100115
+ +
Instructions when using the d command, Debug displays the contents of memory in two parts: the hex (each byte value in hexadecimal format) and ASCII part (the value of each byte are used ASCII code characters.) Each non-printable characters in the ASCII part of the show by a period (.) Said. Each display line shows the contents of 16 bytes, 8 bytes and 9 bytes of a hyphen between. Each display line from a 16-byte boundary.
+ +
Debug: E (type)
Entering data into the memory address specified.
Can type hexadecimal or ASCII format data. Previously stored in the specified location of any data lost.
eaddress
Parameter address
Specify the first input data memory location.
list
Specify the input to the memory of consecutive bytes of data.
Integrated memory for code, please click the "Related Topics" list DebugA (assembly).
Part of the display of memory information, click the "Related Topics" list DebugD (dump).
+ +
Type the following command example assumes that:
ecs: 100
Debug in the following format displays the contents of the first byte:
04BA: 0100EB.
To change the value to 41 at the insertion point, type 41, as follows:
04BA: 0100EB.41_
E command can be typed using a continuous byte value. Type a new value and press SPACEBAR (space bar), rather than press ENTER. Debug display the next value. In this example, three times if you press the SPACEBAR (space key), Debug displays the following values:
04BA: 0100EB.4110.00.BC._
To change the hexadecimal value of 42 BC, at the insertion point, type 42, as follows:
04BA: 0100EB.4110.00.BC.42_
Assume that the decision value of 10 should be 6F. To correct the value, press the HYPHEN key twice to return to the address 0101 (value 10). Debug shows the following:
04BA: 0100EB.4110.00.BC.42-
04BA: 010200 .-
04BA: 010110._
Type 6f changes at the insertion point values ​​as follows:
04BA: 010110.6f_
Press ENTER to stop the e command and return to the Debug prompt.
The following is an example of a string entry:
eds: 100 \ "Thisisthetextexample \"
The string from DS: 100 starts to fill 24 bytes.
+ +
Instructions using the address parameter is not specified if the optional parameter list specified address value case, Debug displays the addresses and content, repeat the next line address, and wait for your input. At this point, you can do the following:
• replace the byte value. To do this, type the new value in the current value. If you type is not a valid hexadecimal value, or value contains more than two figures, Debug does not echo the invalid or extra characters.
• the next byte. To do this, press the SPACEBAR (space bar). To change the byte value, current value, type the new value. If you press SPACEBAR (space bar), move more than 8-bit boundaries, Debug the program will display a new line and the first line displays the new address.
• Return to the previous byte. To do this, press the HYPHEN key (-). You can repeatedly press the HYPHEN key (-) move back over more than one byte. When you press the HYPHEN, Debug to start a new line and display the current address and byte values.
• stop the implementation of e command. To do this, press ENTER. Any byte location can be in the press ENTER.
If the specified list using the list parameter value of the parameter, then use the e command will replace the existing values ​​in the list of byte values. If an error occurs, will not change any byte value.
List value can be string or hexadecimal bytes. Use space, comma or tab separated values. String must be included in the single or double quotes.
+ + + +
Debug: F (fill)
Fills the specified value using the specified memory area address.
You can specify a hexadecimal or ASCII format data. Any previously stored data in the specified location will be lost.
frangelist
Parameter range
Specifies the memory area to fill the starting and ending addresses, or the starting address and length. The range of valid values, click the "Related Topics" list in the "Debug instructions."
list
Specify the input data. List by number or hexadecimal strings together quotes included.
+ +
Type the following command example assumes that:
f04ba: 100l1004245525441
In response, Debug fill the specified value from 04BA: 100 to 04BA: 1FF memory locations. Debug repeated until the value of the five 100h bytes all filled up.
+ +
If the range using the range parameter describes the number of bytes included in the list of values ​​than the large, Debug will repeatedly assign values ​​in the list until all the bytes in the full range fill.
If the memory is in the range of any damage or does not exist, Debug displays the error message and stop f command.
Using the list parameter values ​​if the list contains more than the range in the number of bytes, Debug will ignore the extra value in the list.
Debug: G (steering)
Run the program currently in memory.
g [= address] [breakpoints]
Parameter = address
Specify the current in the memory address to start executing the program. If you do not specify the address, Windows2000 from the CS: IP registers in the execution of the current address.
breakpoints
G command can be set to specify the part 1 to 10 temporary breakpoint.
The execution cycle, repeated string instruction, software interrupt service or information, please click the "Related Topics" list DebugP (execution).
The execution, please click the "Related Topics" list DebugT (tracking).
Type the following command example assumes that:
gcs: 7550
Windows2000 to run the program currently in memory, until the execution to the breakpoint address in the CS section 7550 so far. Debug displays the contents of the register and the flag state and the end of the g command.
The following command sets two breakpoints:
gcs: 7550, cs: 8000
If after a breakpoint in the Debug command again, type g, from the instruction after the breakpoint started, instead of the usual starting address implementation.
+ +
Instructions using the address parameter must be used before the address parameter equal sign (=) to distinguish the start address (address) and the breakpoint address (breakpoints).
Program in a specified breakpoint it encounters the first breakpoint to stop, regardless of what your position in the list of breakpoint type breakpoint. Debug at each breakpoint interrupt code instead of using the original instructions.
When the program reaches a breakpoint, Debug breakpoint address all restored to their original instructions and displays the contents of all registers, the status of all the tags and the final execution of the decoded form. Debug display of the information and use Debugr (register) command and specify the information displayed when the breakpoint is the same.
If the program does not stop on breakpoints, Debug the program will not replace the original instruction interrupt code.
Limitations can only set breakpoints in the 8086 operations include code (opcode) byte of the address of the first set a breakpoint. If you set more than 10 breakpoints, Debug displays the following information:
bperror
The user stack pointer requires the user stack pointer must be valid and must be 6 bytes can be used for the g command. The command uses the iret instruction to this program is being tested. Debug set user stack pointer and the user sign code segment register and instruction pointer pushed onto the user stack. (If the stack is invalid or too small, the operating system may fail.) Debug breakpoint set at the specified interrupt code (0CCh).
Do not re-start the program displays the following message in Windows2000 try to restart the program;
Programterminatednormally
To properly run the program, must use Debugn (name) and l (load) command to reload the program.
+ + + +
Debug: H (Hex)
Implementation of the two parameters specified hexadecimal arithmetic.
hvalue1value2
Parameter value1
Representatives within the range from 0 to FFFFh any hexadecimal digit.
value2
Range from 0 to FFFFh on behalf of the second hexadecimal digit.
+ +
Type the following command example assumes that:
h19f10a
Debug operation is performed with the following results.
02A90095
+ +
Debug shows first two parameters specify the sum, and then subtracted from the first argument the second argument. The calculation results are displayed in a row: first calculation and then calculate the difference.
+ + + +
Debug: I (input)
Read from the specified port and display a byte value.
iport
Port parameters
Address specified by the input port. Address can be 16-bit value.
Byte value will be sent to the output port information, click "Related Topics" list DebugO (output).
+ +
Type the following command example assumes that:
i2f8
Also assume that the port byte value is 42h. Debug read the bytes, and its value is displayed as follows:
42
+ +
Debug: L (Load)
A file or the contents of a particular disk sector into memory.
Loaded from the disk file BX: CX number of bytes specified in register, please use the following syntax:
l [address]
Windows2000 skip directly to the file system and load a specific sector, please use the following syntax:
laddressdrivestartnumber
Parameter address
Specifies the file or sector in which to load the contents of memory location. If you do not specify the address, Debug will use the CS register, the current address.
drive
Specified sectors of the disk contains read the specified drive. The value is numeric: 0 = A, 1 = B, 2 = C and so on.
start
Specify the content to load the first sector of the hexadecimal number.
number
Specifies to load the contents of the hexadecimal number of contiguous sectors. Only the contents of a particular sector to be loaded instead of loading debug command line or the nearest Debugn (name) specified in the command file to use drive, start and number parameters.
L command for the specified files, click the "Related Topics" list Debugn (name).
The write debugging information to a disk file, click the "Related Topics" list Debugw (write).
+ +
Example assumes that start Debug and type the following command:
nfile**
Now you can type the l command to load File**. Debug file will load and display the Debug prompt.
Suppose you want to start from drive C to a logical sector is 15 (0Fh) to 109 (6Dh) sectors to load content to the starting address 04BA: 0100's memory. To do this, type the following command:
l04ba: 10020f6d
+ +
Note that using the l command with no parameters when using the l command with no arguments when the debug command line on the specified file will be loaded into memory from the address CS: 100 start. Debug while the BX and CX registers to load the bytes. If the debug command line does not specify the file, the file will be loaded using the n command is often the last file specified.
Use the command with the address parameter 1 if the address parameter with the l command, Debug memory location address from the beginning to load the contents of the file or specify the sector.
Use the l command with all parameters with all the parameters if you use the l command, Debug will load the contents of the specified disk sectors instead of loading the file.
Load the contents of a particular sector of each sector within the specified range are read from the drive. Debug start loading from the start until the specified number of sectors in the number of the contents of all loaded.
Load. Exe file Debug ignored. Exe files address the address parameter. If you specify. Exe file, Debug will re-locate the file. Exe files load address specified in the header. In. Exe file is loaded into memory before the title itself from. Exe files from, so the disk. Exe file size and memory are different. If you want to check the whole. Exe file, please use a different extension, rename the file.
Debug to open the hex file will have. Hex extension that hexadecimal format. Type without parameters l command, you can load the hex file from the specified address at the beginning of the hex file. If you type the address parameter contains the l command, Debug will specify the address to find the hex address on file to determine the starting address.
Debug: M (mobile)
A memory block contents to another memory block.
mrangeaddress
Parameter range
Specifies the memory area to copy the contents of the starting and ending addresses, or the starting address and length.
address
To copy the contents of the specified range to the location of the start address.
+ +
Type the following command example assumes that:
mcs: 100110cs: 500
Debug first CS: 110 copies the contents of the address to the address CS: 510, and then the CS: 10F copy the contents of the address CS: 50F in this operation until the CS: 100 copies the contents of the address to address CS: 500 in. To view the results, use Debugd (dump) command, and use the m command to specify the destination address.
+ +
Replication of existing data shows the impact if the new data is not written to the data being copied in the address block, the source data will remain unchanged. However, if the target block already contains data (as it covers the same copy operation), it will overwrite the data. (Covering the copy operation is part of that target data block data block covering part of the original operation.)
Perform the copy operation coverage
m command target address of the cover copy operation without losing data. Rewrite the contents of the address of the first copy. Therefore, if the higher bit address data replication to a lower bit address, the copy operation from the original block of the lowest address to highest address to begin. Conversely, if you want to copy data from low address to high address, the original block copy operation from the highest address, the address to a minimum.
+ + + +
Debug: N (name)
Specify Debugl (load) or w (write) command executable file name, or specify the executable file being debugged parameters.
n [drive:] [path] filename
To specify the parameters of the test executable file, please use the following syntax:
nfile-parameters
Parameters if the parameters of the case without the use of the n command to clear the current specification.
[Drive:] [path] filename
To test the executable file specified location and name.
file-parameters
To test the executable file is specified parameters and switches.
On the file or specify the contents of the disk sectors to load into memory, please click the "Related Topics" list DebugL (loaded).
The write debugging information to a disk file, click the "Related Topics" list DebugW (write).
+ +
Example assumes that start Debug, and load the program being debugged Prog**. Then you decide to Prog** specify two parameters and run this program. The following is an example of the command sequence:
debugprog**
nparam1param2
g
In this case, Debugg (move) command will run the program, if you have Windows2000 command prompt, type the following command:
progparam1param2
Therefore, testing and debugging reflect Prog** normal runtime environment.
In the following command sequence, the first n command File1.exe designated as followed by the l (load) command file, the command will File1.exe loaded into memory. The second command specifies File1.exe n parameters will be used. Finally, g command to run File1.exe file, if you Windows2000 command line, type the File1File2.datFile2.dat same.
nfile1.exe
l
nfile2.datfile3.dat
g
• Do not pay attention to the second form of the n command after using the l command. Note also that if we use the w (write) command, Windows2000 will use the name File2.dat save the file being debugged File1.exe. To avoid this result, it should always l or w command n command immediately before the first form.
+ +
N command shows the two uses can be two ways to use the n command. First, you can use it to specify the back of l (load) or w (write) command uses the file. If the debug file is not named in the case of start Debug, you must use the l command to load the file before the command nfilename. In CS: 5C to file control block (FCB) correct layout of the file name format. Second, it can be debugged using the n command to specify the file command line arguments and switches.
Memory area will be subject to the following four memory region n command influence:
The contents of memory location CS: 5C file a document control data block (FCB)
CS: 6C file 2 file control block (FCB)
CS: 80n command line length (in characters)
CS: 81n command-line character at the beginning of the first n command specifies the file name is placed in CS: 5C in the FCB. If you specify a second file name, this name will be placed in CS: 6C in the FCB. n command line, type the number of characters (except for the first character in addition, n) is stored in the location of CS: 80. n the actual characters on the command line (again, in addition to letters other than n) are stored in the CS: 81 start position. Note that these characters can be in Windows2000 command prompt, type any valid command switches and separators.
+ + + +
Debug: O (output)
The byte value is sent to the output port.
oportbyte-value
Port parameters
Address specified by the output port. Port address can be 16-bit value.
byte-value
Specifies the port to point to the byte value.
The byte value read from the input port information, click the "Related Topics" list DebugI (input).
+ +
Example byte value to send to the address 2F8h 4Fh the output port, type the following command:
o2f84f
+ + + +
Debug: P (execution)
Implementation cycle, repeated string instruction, software interrupt or subroutine; or by any other instruction trace.
p [= address] [number]
Parameter = address
The first command specifies the location to be executed. If you do not specify the address, the default address in the CS: IP register specified in the current address.
number
Specifies that the control is returned to the Debug command to be executed before the number. The default is 1.
Currently running in memory the program, please click the "Related Topics" list DebugG (steering).
The execution, please click the "Related Topics" list DebugT (tracking).
+ +
Example assumes that the program being tested at address CS: 143F Office contains a call instruction. To run the subroutine call destination and then return control to the Debug, type the following command:
p = 143f
Debug displays the results in the following format:
AX = 0000BX = 0000CX = 0000DX = 0000SP = FFEEBP = 0000SI = 0000DI = 0000
DS = 2246ES = 2246SS = 2246CS = 2246IP = 1443NVUPEIPLNZACPONC
2246:14427505 JNZ144A
+ +
Instructions to transfer control to the program to test the control when the p command to be sent from the Debug Test program, the program run uninterrupted until the cycle repeated string instruction, software interrupt or the completion of the subroutine until the specified address , or until a specified number of executed machine instructions so far. Control returns to Debug.
If the address parameter of the limit segment address parameter is not specified, Debug the program will be tested using the CS register. If you omit the address, the program from the CS: IP register by the specified location and begin execution. Address parameter must be used before the equal sign (=) to distinguish it from the number parameter. If the instruction at the specified address is not a cycle, repeated string instruction, software interrupt or a subroutine, the p command and Debugt (trace) command the same effect.
Use the p command to display a message when p after the execution of a description, Debug displays the contents of the program register, flag state and the next period of instruction to be executed in the form of decoding.
Warning • can not use the p command to trace the read-only memory (ROM).
Debug: Q (quit)
Stop Debug session without saving the current test file.
When you type q, the control returns to the command prompt Windows2000.
q
Parameters of the command with no arguments.
Information about saving files, click the "Related Topics" list DebugW (write).
+ + + +
Debug: R (register)
Display or change one or more CPU registers.
r [register-name]
Parameters none Used without parameters used in the case, the r command displays the contents of all registers and the register storage area in the logo.
register-name
Specifies the name of the register to display their content.
Part of the display of memory information, click the "Related Topics" list DebugD (dump).
Bytes of information about disassembly, please click the "Related Topics" list DebugU (disassembly).
+ +
Example To see the contents of all registers, and the current status of all marked the location of the instruction decoding table, type the following command:
r
If the current position is CS: 11A, display looks like the following:
AX = 0E00BX = 00FFCX = 0007DX = 01FFSP = 039DBP = 0000SI = 005CDI = 0000
DS = 04BAES = 04BASS = 04BACS = O4BAIP = 011ANVUPDINGNZACPENC
04BA: 011ACD21INT21
To view only the flag state, type the following command:
rf
Debug information in the following format:
NVUPDINGNZACPENC-_
Now you can type in any order one or more valid flag values, which can be with or without spaces, as follows:
nvupdingnzacpenc-pleicy
Debug end of the r command and display the Debug prompt. To see the changes, type r or rf command. Debug displays the following:
NVUPEIPLNZACPECY-_
Press ENTER to return to the Debug prompt.
+ +
Instructions use the r command if you specify the register name, Windows2000 mark will be displayed in hexadecimal representation of 16-bit register value, and appears as a colon prompt. If you want to change the value contained in the register, until you type a new value and press ENTER; Otherwise, press ENTER to return to the Debug prompt.
The following is a valid register name register-name of the RMS: ax, bx, cx, dx, sp, bp, si, di, ds, es, ss, cs, ip, pc, and f. ip and pc are referenced instruction pointer.
If the specified register name, rather than from the front of the list specified, Windows2000 displays the following message:
brerror
Characters instead of using the f register names instead of register if you type the name of the character f, Debug will display the current settings of each marker for the two-letter code, and then display the Debug prompt. To change the flag settings from the table, type the appropriate two-letter codes:
Clear overflow flag were set ovnv
Direction dn (minus) up (increase)
Interrupts ei (enabled) di (disabled)
± ng (negative) pl (positive)
Zero zrnz
Auxiliary carry acna
Parity pe (even parity) po (odd)
Carry cync
You can type in any order the new flag value. Do not need to leave space between these values. To stop the r command, press ENTER. Any sign of a new value is not specified remain unchanged.
With the r command displays the message if you specify multiple values ​​for the marker, Debug displays the following message:
dferror
If you specify not listed in the table in front of a sign code, Debug displays the following message:
bferror
In both cases, Debug will ignore all the bad items after the specified settings.
Debug Debug default settings when you start, will free the memory segment registers set to the lower end of the instruction pointer is set to 0100h, remove all signs, and the remaining register set to zero, in addition to the sp is set to FFEEh outside.
+ + + +
Debug: S (search)
Search for an address range in one or more byte values ​​model.
srangelist
Parameter range
Specifies the search start and end address. For information on valid values ​​range parameters, click the "Related Topics" list in the Debug.
list
Specify one or more byte values ​​mode, or string to search. A space or a comma-separated values ​​for each byte and the next byte value. String values ​​are included in quotation marks.
+ +
Example Suppose you want to find the value of 41 and range from CS: 100 to CS: 110 to all addresses. To do this, type the following command:
scs: 10011041
Debug displays the results in the following format:
04BA: 0104
04BA: 010D
-
The following command in CS: 100 to CS: 1A0 within the search string "Ph".
scs: 1001a0 \ "Ph \"
+ +
Description If the list parameter contains more than one byte values, Debug will only appear the first address byte value. If the list contains only a single byte value, Debug displays the value of the specified range appeared to all addresses.
+ + + +
Debug: T (track)
Execute a command, and displays all the registered content, all signs of the state and the execution of the decoded form.
t [= address] [number]
Parameter = address
Debug start tracking the specified address of the instruction. If the address parameter is omitted, the program will track the CS: IP registers starting at the address specified. Address parameter information about valid values, click the "Related Topics" list in the Debug.
number
Specified number of instructions to follow. This value must be a hexadecimal number. The default is 1.
The execution cycle, repeated string instruction, software interrupt or a subroutine, please click the "Related Topics" list DebugP (execution).
Memory in the execution of the current program information, click the "related topics" list DebugG (steering).
+ +
Example to execute a command (CS: IP points to the instruction), and then displays the contents of the register, flag state and the instruction decoder in the form, please type the following command:
t
If the instructions in the program in the 04BA: 011A, Debug may display the following information:
AX = 0E00BX = 00FFCX = 0007DX = 01FFSP = 039DBP = 0000SI = 005CDI = 0000
DS = 04BAES = 04BASS = 04BACS = O4BAIP = 011ANVUPDINGNZACPENC
04BA: 011ACD21INT21
+ +
Follow instructions in the instruction read-only memory 8086 or 8088 using the t command to microprocessor hardware tracking mode. Therefore, it can track stored in read-only memory (ROM) in the instructions.
Using the address parameter in the address parameter must be used before the equal sign (=) to distinguish it from the number parameter.
Debug: U (Disassembly)
Disassemble the original byte and displays the corresponding statements, including addresses and byte values. Disassembled code looks like has compiled a list of files.
u [range]
Parameters none Used without parameters used in the case, then the u command decomposition 20h bytes (the default), u command from the front shows the first address after the address began.
range
To disassemble code of the specified start address and end address, or the starting address and length. For information on valid values ​​range parameters, click the "Related Topics" list in the Debug.
Integrated memory for code, please click the "Related Topics" list DebugA (assembly).
Part of the display of memory information, click the "Related Topics" list DebugD (dump).
+ +
Examples To disassemble 16 (10h) bytes from the address 04BA: 0100 Start, type the following command:
u04ba: 100l10
Debug displays the results in the following format:
04BA: 0100206472AND [SI +72], AH
04BA: 010369DB69
04BA: 01047665JBE016B
04BA: 0106207370AND [BP + DI +70], DH
04BA: 010965DB65
04BA: 010A63DB63
04BA: 010B69DB69
04BA: 010C66DB66
04BA: 010D69DB69
04BA: 010E63DB63
04BA: 010F61DB61
If only from 04BA: 0100 to 04BA: 0108 a specific address, please type the following command:
u04ba: 01000108
Debug shows the following:
04BA: 0100206472AND [SI +72], AH
04BA: 010369DB69
04BA: 01047665JBE016B
04BA: 0106207370AND [BP + DI +70], DH
+ + + +
Debug: W (write)
Will be written to disk file or a specific partition.
To the BX: CX register contents specified number of bytes written to disk files, using the following syntax:
w [address]
Skip Windows2000 file system and write directly to a particular sector, please use the following syntax:
waddressdrivestartnumber
Parameter address
Specify the file to be written to disk or part of the starting memory address. If you do not specify the address, Debug programs from the CS: 100 start. Valid information on the address parameter, in the "Related Topics" list, click Debug.
drive
Specify the target disk drive contains. The value is numeric: 0 = A, 1 = B, 2 = C, and so on.
start
Specifies the first sector to write the hexadecimal number.
number
Specify the number of sectors to be written.
W command on the specified file for the information, click the "Related Topics" list DebugN (name).
Sector on the contents of the file or files to load into memory, please click the "Related Topics" list DebugL (loaded).
Example assumes that you want to start address CS: 100 memory is written to the disk in drive B. Require data from the disk and start logical sector number 37h continuous 2Bh sectors. To do this, type the following command:
wcs: 1001372b
When the write operation is completed, Debug Debug prompt is displayed again.
+ +
Description must start Debug, or in the recent Debugn (name) command to specify the disk file name. Both of these methods can address CS: 5C at the file control block of the file name correctly formatted.
Using w command without parameters to reset before the BX: CX
If the Debugg (steering), t (trace), p (execution) or r (register) command must use the w command without parameters before the BX: CX register is reset.
The modified files to disk if you modify the file but does not change the file name, length or the starting address, Debug files can still be correctly written to the source disk location.
restrictions can not be used w command to write the order. exe or. hex file.
Warning • Because skip Windows2000 file handle, so write to a specific partition is very dangerous. If you type the wrong value, the disk file structure can easily be damaged.
+ + + +
Debug: XA (extended memory allocation)
Allocation of extended memory specified number of pages.
To use the extended memory must be installed in accordance with version 4.0 of the Lotus / Intel / Microsoft Expanded Memory Specification (LIMEMS) of extended memory device driver.
xa [count]
Parameter count
Specify the distribution of 16KB of extended memory pages.
The use of extended memory Debug commands and other information, please click the "Related Topics" list XD (the release of extended memory), XM (extended memory page mapping) or XS (extended memory status display).
+ +
Examples of extended memory to be allocated eight pages, type the following command:
xa8
If the command is successful, Debug displays the following message similar to:
Handlecreated = 0003
+ +
Note If you specify the number of pages available, Debug will display a message, this message indicates that the handle created by the hexadecimal number; otherwise, Debug displays the error message.
Debug: XD (free extended memory)
Release point to the extended memory handle.
To use the extended memory must be installed in accordance with version 4.0 of the Lotus / Intel / Microsoft Expanded Memory Specification (LIMEMS) of extended memory device driver.
xd [handle]
Parameters handle
Specifies the release handle.
The use of extended memory Debug commands and other information, please click the "Related Topics" list XA (allocate extended memory), XM (extended memory page mapping) or XS (extended memory status display).
+ +
Handle to release the 0003 example, type the following command:
xd0003
If the command is successful, Debug displays the following message:
Handle0003deallocated
+ + + +
Debug: XM (extended memory map page)
Will belong to the extended memory handle specified logical page is mapped to physical pages of extended memory.
To use the extended memory must be installed in accordance with version 4.0 of the Lotus / Intel / Microsoft Expanded Memory Specification (LIMEMS) of extended memory device driver.
xm [lpage] [ppage] [handle]
Parameters lpage
Specify the mapping to physical memory page ppage the logical extension of page number.
ppage
Specify lpage mapped to physical page number.
handle
Specified handle.
The use of extended memory Debug commands and other information, please click the "Related Topics" list XA (extended memory allocation), XD (the release of extended memory) or XS (shown extended memory).
+ +
Examples of logic to handle 0003 is mapped to physical page 5 page 2, type the following command:
xm520003
If the command is successful, Debug displays the following message:
Logicalpage05mappedtophysicalpage02
+ + + +
Debug: XS (extended memory status display)
Displays status information about extended memory.
To use the extended memory must be installed in accordance with version 4.0 of the Lotus / Intel / Microsoft Expanded Memory Specification (LIMEMS) of extended memory device driver.
xs
Parameters of the command with no arguments.
The use of extended memory Debug commands and other information, please click the "Related Topics" list XA (extended memory allocation), XD (the release of extended memory) or XM (extended memory mapped page).
+ +
Examples To display the extended memory, please type the following command:
xs
Debug display similar to the following information:
Handle0000has0000pagesallocated
Handle0001has0002pagesallocated
Physicalpage00 = FramesegmentC000
Physicalpage01 = FramesegmentC400
Physicalpage02 = FramesegmentC800
Physicalpage03 = FramesegmentCC00
2ofatotal80EMSpageshavebeenallocated
2ofatotalFFEMShandleshavebeenallocated
+ +
Debug information displayed shows the following format:
Handlexxhasxxpagesallocated
Physicalpagexx = Framesegmentxx
xxofatotalxxEMSpageshavebeenallocated
xxofatotalxxEMShandleshavebeenallocated
标签: hex, comma, subroutine, arithmetic, compilation, search pattern, registers, ms dos, memory status, memory block, hyphen, command parameters, byte value, memory pages, drive path, information instructions, disk sector, debug commands, instruction software, debug command
分类: OS
时间: 2011-03-09

相关文章

  1. android command Daquan

    android command Daquan Baidu very comprehensive library of documentation: http://wenku.baidu.com/view/20224027 ...
  2. windows command Daquan

    windows command Daquan Check the Windows version of wmimgmt.msc winver Open Windows Management Architecture (w ...
  3. MYSQL command Daquan

    Common MySQL command Daquan First, connect MySQL Format: mysql-h host address-u username-p password 1, Example ...
  4. The use of SQL * PLUS command Daquan

    The use of SQL * PLUS command Daquan Oracle's sql * plus to interact with the oracle client tools. In sql * pl ...
  5. windows DOS command Daquan

    Keywords: windows DOS command Daquan gpedit.msc----- Group Policy sndrec32 ------- recorder Nslookup ------- I ...
  6. linux svn command Daquan

    linux svn command Daquan 1, checkout the file to a local directory svn checkout path (path is the directory on ...
  7. Easy language core support library DLL command Daquan

    Easy language core support library DLL command Daquan . Version 2 . DLL command _ to take a short integer poin ...
  8. linux find command Daquan

    linux command to find the text added, I believe very useful for beginners, here are some commonly used linux f ...
  9. Linux SSH command Daquan

    Linux SSH command Daquan rm-rf mydir / * delete mydir directory * / cd mydir / * mydir directory entry * / cd ...
  10. (Transfer) Liunx SSH command Daquan

    Linux SSH Command Daquan rm -rf mydir /* Remove mydir directory */ cd mydir /* Into the mydir directory */ cd ...
  11. AWARD BIOS settings completely manual (CMOS settings command Daquan. Set Chinese translation)

    AWARD BIOS settings completely manual (CMOS settings command Daquan, set Chinese translation) Collection AWARD ...
  12. Download Linux command Daquan

    Ebook Linux command Daquan. Chm, see Annex
  13. MySQL command Daquan Classic Edition (switch)

    The following article introduces the MySQL command Daquan, including the MySQL database of commonly used comma ...
  14. [Reserved] linux View System Information command Daquan

    [Reserved] linux View System Information command Daquan System # Uname-a # See kernel / operating system / CPU ...
  15. Under the commonly used commands vi editor linux command Daquan

    Under the commonly used commands vi editor linux command Daquan Text editor is the most commonly used of all c ...
  16. Linux unzip command Daquan

    Linux unzip command Daquan how to do it under linux is a gzip file extensions? 1. To. A file extension: # Tar ...
  17. python debug command

    In python, pdb module can be debugged using import pdb pdb.set_trace () You can also use python-m pdb mysqcrip ...
  18. Commonly used commands under linux vi editor command Daquan

    Commonly used commands under linux vi editor command Daquan The text editor is the most commonly used of all c ...
  19. windows run command Daquan

    windows run command Daquan winver check the Windows version wmimgmt.msc open the Windows Management Infrastruc ...