DEBUG Command Detailed _dos/bat

Source: Internet
Author: User
Tags switches



DEBUG:A (Compendium)





Merges the 8086/8087/8088 memory code directly into memory.


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


A [address]


Parameters


Address


Specifies where to type assembly-language instructions. Use a hexadecimal value for address and type each value that does not end with the "H" character. If you do not specify an address, a will start the Assembly at its last stop.


For information about entering data into a specified byte, refer to debug E (type).


For information on disassembly bytes, refer to debug U (Disassembly)


Description


Using Memory codes


The substitution memory code for the segment is CS:, ds:, es: and SS:. The remote return of the memory code is RETF. The memory code for string processing must explicitly declare the string size. For example, you can use MOVSW to move a 16-bit string and use MOVSB to move a 8-bit byte string.


Assembly jumps and calls


The assembler automatically assembles short, near, and far jumps and calls to the destination address based on byte substitution. You can override such a jump or call by using the 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 near jump


0100:0505 jmp far 50a; A 5-byte far jump


You can abbreviate the near prefix to NE.


Distinguishing between word and byte memory locations


When an operand can refer to a Word memory location or byte memory location, the data type must be specified with the prefix word ptr or prefix byte ptr. The acceptable abbreviations are wo and by. The following example shows two formats:


Dec wo [Si]


Neg byte ptr [128]


Specify operands


Debug uses the idioms that include the operands in brackets ([]) to refer to the memory address. This is because Debug, on the other hand, cannot differentiate between immediate operands and memory address operands. The following example shows two formats:


MOV ax,21; Load AX with 21h


mov ax,[21]; Load AX with the


; Contents of


; Memory Location 21h


Using pseudo directives


Use a command to provide two commonly used pseudo directives: db opcode, the byte value is compiled directly into memory, DW opcode, the word value is compiled directly into memory. The following are examples of two pseudo directives:


DB 1,2,3,4, "This is a EXAMPLE"


DB ' is A quotation MARK: '


DB "This is A quotation MARK: '"


DW 1000,2000,3000, "BACH"


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])


All opcode synonyms are also supported, as shown in the following example:


Loopz 100


Loope 100


JA 200


Jnbe 200


For the 8087 opcode, 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





DEBUG:C (comparison)





Compare two parts of memory.


C Range Address


Parameters


Range


Specifies the starting and ending addresses, or the starting address and length, of the first area of memory to be compared.


Address


Specifies the starting address of the second memory area to compare. For information about valid address values, see the "Debug instructions."


Description


If the range and address memory areas are the same, debug will return directly to the debug prompt without displaying any content. If there are differences, Debug will appear in the following format:


Address1 byte1 Byte2 Addess2


Example


The following command has the same effect:


c100,10f 300


C100L10 300


Each command compares 100h to 10Fh memory blocks with 300h to 30Fh memory data blocks.


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


197f:0100 4D E4 197f:0300


197f:0101 197f:0301


197f:0102 A3 197f:0302


197f:0103 F3 197f:0303


197f:0104 BD 197f:0304


197f:0105 197f:0305


197f:0107 197f:0307


197f:0108 E6 197f:0308


197f:0109 2C 197f:0309


197F:010A 0A 197f:030a


197f:010b 7F 197f:030b


197f:010c be 197f:030c


197f:010d 197f:030d


197f:010e 197f:030e


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


Note the address 197f:0106 and 197f:0306 are missing from the list. This indicates that the values in those addresses are the same.





Debug:d (Dump)





Displays the contents of a certain range of memory addresses.


d [Range]


Parameters


Range


Specifies the starting and ending addresses, or the starting address and length, of the memory area whose contents you want to display. If you do not specify that the RANGE,DEBUG program will display 128 bytes of content from the end of the range of addresses specified in the previous D command.


For information about displaying register contents, see Debug R (Register).


Description


When you use the D command, Debug displays memory content in two parts: the hexadecimal portion (the value of each byte is represented in hexadecimal format) and the ASCII portion (the value of each byte is represented by an ASCII character). Each non-printing character is represented by a period (.) in the ASCII portion of the display. Each display line displays 16 bytes of content, and a hyphen between byte 8th and 9th bytes. Each display row starts at a 16-byte boundary.


Example


Suppose you type the following command:


dcs:100 10f


Debug Displays the contents of the range in the following format:


04ba:0100 4F 4D to 59-45 the same as TOM. SAWYER ...


If you type the D command without parameters, Debug formats the display as described in the previous example. Each row displayed is 16 bytes larger than the previous one (8 bytes if the screen showing 40 columns) begins.


For each subsequent d command that you type without parameters, Debug displays the byte content immediately after the last command displayed.


If you type the following command, Debug will display 20h bytes of content starting with cs:100:


dcs:100 L 20


If you type the following command, Debug displays the contents of all bytes from 100h to 115h in the range from CS segment:


DCS:100 115





Debug:e (Type)





Enter data into the specified address in memory.


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


e address [list]


Parameters


Address


Specifies the first memory location of the input data.


List


Specifies the data to be entered into contiguous bytes of memory.


For information about integrated memory codes, see Debug A (assembly).


For information about displaying portions of memory, see Debug D (Dump).


Description


Using the address parameter


If you specify the value of address without specifying the value of the optional list parameter, Debug displays the addresses and contents, repeats the address on the next line, and waits for your input. At this point, you can do one of the following:


Replaces the byte value. To do this, type the new value after the current value. If you type a value that is not a valid hexadecimal value, or if the value contains more than two digits, Debug does not echo the invalid or extra characters.


Enter the next byte. To do this, press SPACEBAR (space bar). To change the value in this byte, type the new value after the current value. If you press SPACEBAR (SPACEBAR), the move exceeds the 8-bit limit, and the Debug program displays a new row and displays the new address at the beginning of the line.


Returns to the previous byte. To do this, press the hyphen key (-). You can repeatedly press the hyphen key (-) to move more than one byte backwards. When you press hyphen, Debug starts a new row and displays the current address and byte values.


Stop the Execute e command. To do this, press the ENTER key. You can press ENTER at any byte position.


Using the list parameter


If you specify the value of the list parameter, the subsequent e command replaces the existing byte value with the value in the list. If an error occurs, no byte values are changed.


The List value can be a hexadecimal byte or a string. Use spaces, commas, or tabs to separate values. You must include the string in single or double quotes.


Example


Suppose you type the following command:


ecs:100


Debug Displays the contents of the first byte in the following format:


04ba:0100 EB.


To change the value to 41, type 41 at the insertion point as follows:


04ba:0100 eb.41_


You can type a contiguous byte value with an e command. Press SPACEBAR (SPACEBAR) after typing the new value instead of pressing the ENTER key. Debug displays the next value. In this example, if you press three times SPACEBAR (SPACEBAR), Debug displays the following value:


04ba:0100 eb.41 10. Bc._


To change the hexadecimal value BC to 42, type 42 at the insertion point as follows:


04ba:0100 eb.41 10. Bc.42_


Suppose the decision value of 10 should be 6F. To correct this value, press the hyphen key two times to return to address 0101 (value 10). Debug Displays the following:


04ba:0100 eb.41 10. bc.42-


04ba:0102 00.-


04ba:0101 10._


Type the 6f change value at the insertion point as follows:


04ba:0101 10.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 "This is the text example"


The string will populate 24 bytes starting with ds:100





Debug:f (fill)





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


You can specify data that is represented in hexadecimal or ASCII format. Any data previously stored at the specified location will be lost.


F Range List


Parameters


Range


Specifies the starting and ending addresses, or the starting address and length, to populate the memory area. For information about valid range values, see the "Debug description."


List


Specifies the data to enter. A List can consist of hexadecimal numbers or strings that are included in quotes.


Description


Using the range parameter


If the range contains a larger number of bytes than the list, Debug repeats the value in the list until all the bytes in the range are filled.


If any memory in the range is corrupted or does not exist, Debug displays an error message and stops the F command.


Using the list parameter


If the list contains more values than the number of bytes in the range, Debug ignores the extra values in the list.


Example


Suppose you type the following command:


F04BA:100L100 42 45 52 54 41


In response, Debug fills the memory location from 04ba:100 to 04ba:1ff with the specified values. Debug repeats these five values until the 100h bytes are fully populated.





DEBUG:G (Steering)





Run the program that is currently in memory.


g [=address] [breakpoints]


Parameters


=address


Specifies the address of the program currently in memory to begin execution. If you do not specify Address,windows 2000, the program will begin executing from the current address in the CS:IP register.


Breakpoints


Specifies 1 to 10 temporary breakpoints that can be set to a portion of the G command.


For information about performing loops, duplicate string directives, software interrupts, or subroutines, see Debug P (Execute).


For information on executing instructions, see Debug T (Trace)





Debug:h (hex)





Performs a hexadecimal operation on the specified two parameters.


H value1 value2


Parameters


Value1


Represents any hexadecimal number from 0 through the FFFFh range.


value2


Represents the second hexadecimal number in the range from 0 to FFFFh.


Description


Debug first adds the specified two parameters, and then subtracts the second argument from the first argument. The results of these calculations are shown on a single line: first calculate and then compute the difference.


Example


Suppose you type the following command:


h19f 10a


Debug performs the operation and displays the following results.


02A9 0095





DEBUG:I (Input)





Reads and displays a byte value from the specified port.


I port


Parameters


Port


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


For information about sending byte values to the output port, see Debug O (Output).


Example


Suppose you type the following command:


I2f8


Also assume that the port's byte value is 42h. Debug reads the byte and displays its value as follows:


42





Debug:l (Loaded)





Loads the contents of a file or a specific disk sector into memory.


To load the contents of the byte number specified in the BX:CX register from the disk file, use the following syntax:


l [Address]


To bypass the Windows 2000 file system and load specific sectors directly, use the following syntax:


L Address Drive Start number


Parameters


Address


Specifies the memory location in which to load the contents of the file or sector. If Address,debug is not specified, the current address in the CS register will be used.


Drive


Specifies the drive that contains the disk that reads the specified sector. The value is numeric: 0 = A, 1 = B, 2 = C, and so on.


Start


Specifies the hexadecimal number of the first sector whose contents you want to load.


Number


Specifies the hexadecimal number of contiguous sectors whose contents you want to load. You can use the drive, start, and number parameters only if you want to load the contents of a particular sector instead of loading the files specified in the debug command line or the most recent debug n (name) command.


For information about specifying files for the l command, see Debug N (Name).


For information about writing to a file that is debugged to disk, see Debug W (Write).


Attention


Use l command with no parameters


When the L command with no parameters is used, the file specified on the debug command line is loaded into memory, starting with the address cs:100. Debug also sets BX and CX registers to the number of bytes loaded. If you do not specify a file on the debug command line, the mounted file will be the file that was frequently specified by the most recent n command.


Use the 1 command with the address parameter


If you use the L command with the address parameter, Debug starts loading the file or the contents of the specified sector from the memory location address.


Using the L command with all parameters


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


Load the contents of a specific sector


Each sector within the specified range is read from drive. Debug loads from start until the contents of the sectors specified in number are loaded.


Loading an. exe file


Debug ignores the address addressing parameter of the. exe file. If you specify an. exe file, Debug will relocate the file to the load address specified in the header of the. exe file. The header itself is detached from the. exe file before the. exe file is loaded into memory, so the size of the. exe file on the disk differs from memory. If you want to check the entire. exe file, rename the file with a different extension.


Open a hexadecimal file


Debug will have the. hex extension as a file that is considered a hexadecimal format file. Type an L command with no parameters to load the hexadecimal file that starts at the address specified in the hexadecimal file. If the l command you type contains an address parameter, Debug adds the specified address to the addresses found in the hexadecimal file to determine the starting address.


Example


Suppose you start Debug and type the following command:


Nfile.com


You can now type the L command to load the file.com. Debug loads the file and displays the debug prompt.


Suppose you need to load the contents of a 109 (6Dh) sector that has a starting logical sector (0FH) from drive C into memory from the starting address 04ba:0100. To do this, type the following command:


L04BA:100 2 0f 6d





Debug:m (move)





Copies the contents of one memory block to another memory block.


M range Address


Parameters


Range


Specifies the starting and ending addresses, or the starting address and length, of the memory area where the content is to be copied.


Address


Specifies the starting address to copy the range content to at this location.


Description


Impact of replication operations on existing data


If the new data is not written to an address in the data block being replicated, the source data remains unchanged. However, if the target block already contains data (as it does in the overwrite copy operation), the data will be overwritten. (Overlay copy operations are those that partially cover the contents of the original block of data in the target block.) )


Performing an overlay copy operation


The M command performs an overlay copy operation on the destination address without losing data. The content of the overwritten address is copied first. Therefore, if data from a higher bit address is copied to a lower-bit address, the copy operation begins at the lowest address of the original block and is performed to the highest address. Conversely, if the data is to be copied from a low address to a high address, the copy operation begins at the highest address of the original block and to the lowest address.


Example


Suppose you type the following command:


mcs:100 cs:500


Debug first copies the contents of the CS:110 address into the address cs:510, and then copies the contents of the cs:10f address to cs:50f until the contents of the cs:100 address are copied to the address cs:500. To view the results, use the Debug d (dump) command and specify the destination address using the M command





DEBUG:N (name)





Specifies the name of the executable file for the debug L (load) or W (write) command, or specifies the parameters of the executable that is being debugged.


n [drive:][path] filename


To specify parameters for the executable file for the test, use the following syntax:


N file-parameters


Parameters


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


[Drive:] [path] FileName


Specifies the location and name of the executable file you want to test.


File-parameters


Specify parameters and switches for the executable file you are testing.


For information about loading the contents of a file or a specified disk sector into memory, see Debug L (Load).


For information about writing to a file that is debugged to disk, see Debug W (Write).


Description


Two uses of the n command


You can use the n command in two different ways. First, you can use it to specify the files that are used by the later L (load) or W (write) commands. If you start debug without naming the debugged file, you must use the command nfilename before loading the file with the L command. Format the file name correctly in cs:5c for the document control block (FCB). Second, you can use the n command to specify command-line arguments and switches for the file being debugged.


Memory Area


The following four memory regions will be affected by the N command:


Memory location


Content


cs:5c


File control data block for file 1 (FCB)


cs:6c


File control data block for File 2 (FCB)


Cs:80


n the length of the command line, expressed in characters


cs:81


n the beginning of a command line character


The first file name specified for the n command is placed in the cs:5c FCB. If you specify a second file name, this name is placed in the cs:6c FCB. n the number of characters typed on the command line (except the first character, N) is stored in the location cs:80. The actual characters on the command line (again, except for the letter N) are stored in a position beginning with cs:81. Note These characters can be any switches and delimiters that are valid in a command typed at the Windows 2000 command prompt.


Example


Assume that debug has been started and that the program prog.com that is being debugged is loaded. You then decide to specify two parameters for prog.com and run this program. The following is a sequence of commands for this example:


Debug prog.com


NPARAM1 param2


G


In this case, the Debug g (steering) command runs the program as if you had typed the following command at the Windows 2000 command prompt:


Prog param1 param2


As a result, testing and debugging reflect Prog.com's usual run-time environment.


In the following sequence of commands, the first n command designates File1.exe as the file for the later L (loaded) command, which loads the File1.exe into memory. The second n command specifies the parameters that File1.exe will use. Finally, the G command runs the File1.exe file as if you typed File1 File2.dat File2.dat on the Windows 2000 command line.


Nfile1.exe


L


Nfile2.dat File3.dat


G


Attention


Do not use the L command after the second form of the n command. Also note that if you use the W (write) command now, Windows 2000 will use the name File2.dat to save the file File1.exe you are debugging. To avoid this result, you should always use the first form of the n command immediately before the L or W commands.





Debug:o (Output)





Sends the byte value to the output port.


O Port Byte-value


Parameters


Port


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


Byte-value


Specifies the byte value to point to port.


For information on reading byte values from an input port, see Debug I (Input).


Example


To send a byte value of 4Fh to an output port with an address of 2F8h, type the following command:


O2f8 4f





Debug:p (execution)





Execute loops, duplicate string directives, software interrupts, or subroutines, or trace them through any other instruction.


p [= address] [number]


Parameters


=address


Specifies the first position to execute the instruction. If you do not specify an address, the default address is the current address specified in the CS:IP register.


Number


Specifies the number of instructions to execute before the control is returned to Debug. The default value is 1.


For information about running programs that are currently in memory, refer to debug G (steering).


For information on executing instructions, see Debug T (Trace).


Description


Control transfer to the program to be tested


When the P command transfers control from Debug to the program to be tested, the program runs uninterrupted until a loop, repeating string instruction, software interruption, or a subroutine completes the specified address, or until a specified number of machine instructions are executed. Control returns to Debug.


Restrictions on Address parameters


If the address parameter does not specify a segment, Debug uses the CS register of the program being tested. If you omit address, the program will begin execution from the addresses specified in the CS:IP register. You must use the equal sign (=) before the address parameter to distinguish it from the number parameter. If the instruction at the specified address is not a loop, duplicate string instruction, software interrupt, or subroutine, the P command works the same as the Debug T (Trace) command.


Messages displayed using the P command


When P finishes a description, Debug displays the contents of the program's registers, the status of the flags, and the decoding of the next instruction to be executed.


Warning


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


Example


Assume that the program you are testing contains a call instruction at the address cs:143f. To run the subroutine of the call target and return control to Debug, type the following command:


p=143f


Debug displays the 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 NC


2246:1442 7505 jnz 144A





Debug:q (Exit)





Stops the Debug session and does not save the file for the current test.


After you type Q, control returns to the DOS command prompt.


Q


Parameters


The command takes no parameters.


For information about saving files, see Debug W (Write).





Debug:r (Register)





Displays or alters the contents of one or more CPU registers.


R [Register-name]


Parameters


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 name of the register whose contents you want to display.


For information about displaying portions of memory, see Debug D (Dump).


For information about disassembly bytes, refer to debug U (Disassembly).


Description


Using the R command


If a register name is specified, Windows 2000 displays the 16-bit value of the register represented in hexadecimal notation and displays the colon as a prompt. If you want to change the value contained in the register, press ENTER to return to the Debug prompt unless you type a new value and press ENTER.


Valid register name


The following are valid values for Register-name: AX, BX, CX, DX, SP, BP, Si, Di, ds, ES, SS, CS, IP, PC and F. Both IP and PC refer to the instruction pointer.


If you specify a register name, instead of specifying it from the previous list, Windows 2000 displays the following message:


BR Error


Use F character instead of register name


If you type the F character instead of the register name, debug displays the current setting for each tag as two-letter code, and then displays the debug prompt. To change the settings for a flag, type the appropriate two-letter code from the following table:


Flag Name


Set up


Clear


Overflow


Ov


Nv


Direction


DN (minus)


Up (Increase)


Interrupt


EI (enabled)


DI (disabled)


Negative


Ng (negative)


PL (positive)


Zero


Zr


nz


Auxiliary rounding


Ac


Na


Parity check


PE (even check)


Po (Odd check)


Carry


Cy


nc


You can type a new flag value in any order. There is no need to leave a space between these values. To stop the R command, press the ENTER key. Any flags that do not specify a new value remain unchanged.


Messages displayed with the R command


If more than one value is specified for the tag, Debug displays the following message:


DF Error


If you specify a flag code that is not listed in the previous table, Debug displays the following message:


BF Error


In both cases, Debug ignores any settings that were specified after the invalid project.


The default settings for Debug


When you start Debug, the segment registers are set to the low end of free memory, the instruction pointer is set to 0100H, all flags are cleared, and the remaining registers are set to zero, except for the SP that is set to FFEEh.





Debug:r





Example


To view the contents of all registers, the status of all tags, and the instruction decoding table for the current location, type the following command:


R


If the current position is cs:11a, the display looks 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 only the status of a flag, type the following command:


Rf


Debug displays information in the following format:


NV up DI NG NZ AC PE NC-_


You can now type one or more valid flag values in any order, with or without spaces, as follows:


NV up di ng NZ ac pe nc-pleicy


Debug closes the R command and displays the debug prompt. To view the changes, type the R or RF command. Debug Displays the following:


NV up EI PL NZ AC PE CY-_


Press ENTER to return to the Debug prompt.





Debug:s (search)





A pattern that searches for one or more byte values in an address range.


S range List


Parameters


Range


Specifies the start and end addresses to search for scopes.


List


Specifies the pattern of one or more byte values, or the string to search for. Separate each byte value and the next byte value with a space or comma. Include string values in quotation marks.


Description


If the list parameter contains more than one byte value, Debug displays only the first address in which the byte value appears. If the list contains only one byte value, Debug displays all the addresses in the specified range where the value appears.


Example


Suppose you need to find all addresses that contain a value of 41 and range from cs:100 to cs:110. To do this, type the following command:


SCS:100 110 41


Debug displays the results in the following format:


04ba:0104


04ba:010d


-


The following command searches the string "Ph" within the range of cs:100 to cs:1a0.


scs:100 1a0 "Ph"





DEBUG:T (Tracking)





(Sorry,debug:t part vacant, if any netizen has this part, please inform me)


Aogo added:


Executes the specified number of code from the current segment address, displaying the value of all registers, including the flag registers, each time.


such as: t 10


Assuming that the current is in cs:100, then 10 lines of code will be executed from cs:100, and changes to the registers will be displayed after each line of code executes. )





Debug:u (Disassembly)





Disassemble the byte and display the corresponding original statement, which includes the address and byte values. The disassembly code looks like a list of compiled files.


u [Range]


Parameters


No


If used without parameters, the U command decomposes the 20h byte (the default), starting at the first address after the address shown in the previous U command.


Range


Specifies the starting and ending addresses, or the starting address and length, of the code to disassemble.


For information about integrated memory codes, see Debug A (assembly).


For information about displaying portions of memory, see Debug D (Dump).


Example


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


U04ba:100l10


Debug displays the results in the following format:


04ba:0100 206472 and [Si+72],ah


04ba:0103 DB 69


04ba:0104 7665 Jbe 016B


04ba:0106 207370 and [Bp+di+70],dh


04ba:0109 DB 65


04BA:010A DB 63


04BA:010B DB 69


04BA:010C DB 66


04BA:010D DB 69


04ba:010e DB 63


04ba:010f DB 61


If you only display information from 04ba:0100 to 04ba:0108 specific addresses, type the following command:


U04ba:0100 0108


Debug Displays the following:


04ba:0100 206472 and [Si+72],ah


04ba:0103 DB 69


04ba:0104 7665 Jbe 016B


04ba:0106 207370 and [Bp+di+70],dh





Debug:w (Write)





AoGo: Only valid for COM, because EXE is with relocation information, and debug cannot generate relocation information so cannot write to exe.


Writes a file or a specific partition to disk.


To write the contents of a specified number of bytes in the BX:CX register to a disk file, use the following syntax:


w [Address]


To bypass the Windows 2000 file system and write directly to specific sectors, use the following syntax:


W Address Drive start number


Parameters


Address


Specifies the starting memory address of a file or part of a file to write to a disk file. If you do not specify the Address,debug program will start from cs:100.


Drive


Specifies the drive that contains the destination disk. The 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 write.


For information about specifying files for the W command, refer to debug N (name).


For information about loading the contents of a file or a file sector into memory, see Debug L (Load).


Description


You must specify the name of the disk file when you start Debug or in the most recent debug n (name) command. Both of these methods correctly format the file name of the cs:5c in the address-control block.


Reset the BX:CX before using the W command with no parameters


If you use the Debug g (steering), T (Trace), P (execute) or R (register) commands, you must reset the BX:CX register before using the W command without parameters.


Write the modified file to disk


If you modify the file without changing the file name, length, or start address, Debug can still correctly write the file to the source disk location.


Limitations of the W command


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


Warning


Writing to a specific partition is dangerous because it skips over Windows 2000 file handles. If you type the wrong value, the disk file structure can easily be corrupted.


Example


Suppose you want to write the memory contents of the starting address cs:100 to disk on drive B. You need to start the data from the logical sector area code 37H of the disk and continue to 2Bh sectors. To do this, type the following command:


WCS:100 1 2b


When the write operation is complete, Debug displays the debug prompt again.





DEBUG:XA (Allocate extended memory)





Allocates the specified number of pages for extended memory.


To use extended memory, you must install an extended memory device driver that conforms to the version 4.0 Lotus/intel/microsoft Extended memory specification (LIM EMS).


XA [count]


Parameters


Count


Specifies the number of 16KB pages of extended memory to allocate.


For information about other debug commands that use extended memory, see Debug XD (Free extended memory), debug XM (Map extended memory page), or debug XS (show extended memory status).


Description


If the specified number of pages is available, Debug displays a message that indicates the hexadecimal number of the handle being created, or debug displays an error message.





Debug:xa





Example


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


Xa8


If the command succeeds, Debug displays the following message similar to:


Handle created=0003





Debug:xd (free extended memory)





Releases a handle to the extended memory.


To use extended memory, you must install an extended memory device driver that conforms to the version 4.0 Lotus/intel/microsoft Extended memory specification (LIM EMS).


XD [Handle]


Parameters


Handle


Specifies the handle to be freed.


For information about other debug commands that use extended memory, see Debug XA (Allocate extended memory), debug XM (Map extended memory page), or debug XS (show extended memory status).


Example


To release handle 0003, type the following command:


XD 0003


If the command succeeds, Debug displays the following message:


Hdle 0003 deallocated





DEBUG:XM (Map extended memory pages)





Maps an extended memory logical page that belongs to the specified handle to the physical page of the extended memory.


To use extended memory, you must install an extended memory device driver that conforms to the version 4.0 Lotus/intel/microsoft Extended memory specification (LIM EMS).


XM [Lpage] [ppage] [handle]


Parameters


Lpage


Specifies the logical page number of the extended memory to map to the physical page ppage.


Ppage


Specifies the physical page number to which lpage is mapped.


Handle


Specifies the handle.


For information about other debug commands that use extended memory, see Debug XA (Allocate extended memory), Debug XD (Free extended memory), or debug XS (show extended memory).


Example


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


XM 5 2 0003


If the command succeeds, Debug displays the following message:


Logical page mapped to physical page 02





DEBUG:XS (Show extended memory status)





Displays information about the state of the extended memory.


To use extended memory, you must install an extended memory device driver that conforms to the version 4.0 Lotus/intel/microsoft Extended memory specification (LIM EMS).


Xs


Parameters


The command takes no parameters.


For information about other debug commands that use extended memory, see Debug XA (Allocate extended memory), Debug XD (Free extended memory), or debug XM (map extended memory pages).


Description


The information that is displayed in 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


Example


To display extended memory information, type the following command:


Xs


Debug displays information similar to the following:


Handle 0000 has 0000 pages allocated


Handle 0001 has 0002 pages allocated


Physical page = Frame Segment C000


Physical page = Frame Segment C400


Physical page = Frame Segment C800


Physical page = Frame Segment CC00


2 of a total of EMS pages have been allocated


2 of a total FF EMS handles have been allocated

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.