Debug: A (assembly)
Directly merge the 8086/8087/8088 Memory code into the memory.
This command creates executable machine codes from assembly language statements. All values are in hexadecimal format and must be entered by one to four characters. Specify the prefix memory before the referenced operation code.
A [address]
Parameters
Address
Specifies the location where the assembly language instruction is entered. Use a hexadecimal value for address and type each value that does not end with the character "h. If no address is specified, a starts assembly at the last stop.
For information about inputting data into a specified byte, see Debug E (type ).
For information on disassembly bytes, see Debug U (disassembly)
Description
Use the 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 for string processing must explicitly declare the string size. For example, movsw can be used to move 16-bit strings and movsb can be used to move 8-bit byte strings.
Assembly jump and call
The assembler automatically assembles short, near and far jumps and calls to the target address based on the replacement of bytes. You can use the near or far prefix to replace such a jump or call, 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 abbreviated the near prefix as ne.
Differentiate characters and byte memory locations
When an operand can reference a word memory location or byte memory location, you must use the prefix word ptr or byte ptr to specify the data type. Acceptable abbreviations are wo and. The following example shows two formats:
Dec wo [si]
Neg byte ptr [128]
Specified operand
Debug uses the memory address referenced by the operands included in brackets. This is because Debug cannot distinguish between the immediate operand and the memory address operand. The following example shows two formats:
Mov ax, 21; load AX with 21 h
Mov ax, [21]; load AX with
; Contents
; Memory location 21 h
Use pseudoinstructions
Use the command to provide two commonly used pseudo commands: db operation code, which assembles byte values directly into the memory, dw operation code, and word values directly into the memory. The following are examples of two pseudo commands:
Db 1, 2, 3, 4, "this is an example"
Db 'this is a quotation mark:'
Db "this is a quotation mark: '"
Dw 3000, "BACH"
Example
Command a 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 operation code synonyms are also supported, as shown in the following example:
Loopz 100
Loope 100
Ja 200
Jnbe 200
For the 8087 operation code, you must specify the 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 the memory.
C range address
Parameters
Range
Specify the start and end addresses, or the start address and length of the first area of memory to be compared.
Address
Specifies the starting address of the second memory area to be compared. For information about valid address values, see "Debug description ".
Description
If the range and address memory regions are the same, Debug returns directly to the Debug prompt without displaying any content. If there are differences, Debug will be displayed in the following format:
Address1 byte1 byte2 addess2
Example
The following command has the same effect:
C100, 10f 300
C100l10 300
Each Command compares the memory data blocks of 100 h to 10 FH with those of 300 h to 30 FH.
Debug responds to the preceding 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 addresses 197F: 0106 and 197F: 0306 are missing in the list. This indicates that the values in the addresses are the same.
Debug: D (dump)
Display the content of a certain range of memory addresses.
D [range]
Parameters
Range
Specify the start and end addresses, or the start address and length of the memory area where the content is to be displayed. If range is not specified, the Debug program displays 128 bytes of content starting from the end of the address range specified in the previous d command.
For information about the display register content, see Debug R (register ).
Description
When the d command is used, Debug displays the memory content in two parts: the hexadecimal part (the value of each byte is expressed in hexadecimal format) and ASCII code (each byte value is represented by ASCII characters ). Each non-printable character is represented by a period (.) In the displayed ASCII section. Each display line displays 16 bytes of content, with a hyphen between 8th bytes and 9th bytes. Each display line starts at the boundary of 16 bytes.
Example
Run the following command:
Dcs: 100 10f
Debug displays the content 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 enter the d command without parameters, Debug orchestrates the display format according to the content described in the previous example. The displayed line starts with a address that is 16 bytes larger than the address of the previous line (if the screen of 40 columns is displayed, It is 8 bytes.
For each d command without Parameters entered later, Debug displays the byte content immediately after the last command is displayed.
If you type the following command, Debug displays 20 h bytes of content starting from CS: 100:
Dcs: 100 l 20
If you type the following command, Debug displays all bytes in the range from 100 h to 115 h in the CS segment:
Dcs: 100 115
Debug: E (type)
Input data to the address specified in the memory.
You can enter data in hexadecimal or ASCII format. All data previously stored at the specified location is lost.
E address [list]
Parameters
Address
Specify the first memory location of the input data.
List
Specifies the data in consecutive bytes to be input into the memory.
For information on integrated memory codes, see Debug A (assembly ).
For information on displaying part of the memory, see Debug D (dump ).
Description
Use address parameters
If you specify the address value without specifying the optional list parameter value, Debug displays the address and content, repeat the address in the next line, and waits for your input. In this case, you can perform one of the following operations:
Replace the byte value. To do this, enter a new value after the current value. If the entered value is not a valid hexadecimal value or contains more than two numbers, Debug does not display invalid or additional characters.
Enter the next byte. Therefore, Press SPACEBAR (Space key ). To change the value in this byte, enter a new value after the current value. If you press the SPACEBAR (Space key) and the Movement exceeds the 8-bit limit, the Debug program displays a new line and a new address at the beginning of the line.
Returns the first byte. Therefore, press the HYPHEN key (-). You can repeatedly press the HYPHEN key (-) to move more than one byte backward. When you press HYPHEN, Debug starts a new line and displays the current address and byte value.
Stop executing the e command. Therefore, press ENTER. You can press ENTER at any byte location.
Use list Parameters
If the value of the list parameter is specified, the subsequent e command replaces the existing byte value with the value in the list. If an error occurs, no byte value will be changed.
The List value can be a hexadecimal byte or string. Use spaces, commas, or tabs to separate values. Strings must be included in single or double quotation marks.
Example
Run the following command:
Ecs: 100
Debug displays the content of the first byte in the following format:
04BA: 0100 EB.
To change the value to 41, type 41 at the insertion point, as shown below:
04BA: 0100 EB.41 _
You can use an e command to Type Continuous byte values. Press SPACEBAR (Space key) instead of ENTER after you type a new value. Debug displays the next value. In this example, If You Press SPACEBAR three times, Debug displays the following values:
04BA: 0100 EB.41 10. 00. BC ._
To change the hexadecimal value BC to 42, Type 42 at the insertion point, as shown below:
04BA: 0100 EB.41 10. 00. BC.42 _
Assume that the value 10 should be 6F. To correct this value, press the HYPHEN key twice to return to address 0101 (value: 10 ). Debug displays the following content:
04BA: 0100 EB.41 10. 00. BC.42-
04BA: 0102 00 .-
04BA: 0101 10 ._
At the insert point, type 6f to change the value, as shown below:
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:
Eds: 100 "This is the text example"
The string will be filled with 24 bytes starting from DS: 100
Debug: F (fill)
Fill in the address in the specified memory area with the specified value.
Data in hexadecimal or ASCII format can be specified. Any data previously stored in the specified location will be lost.
F range list
Parameters
Range
Specify the start and end addresses, or the start address and length of the memory area to be filled. For more information about valid range values, see "Debug description ".
List
Specify the data to be input. A List can be a string consisting of hexadecimal numbers or quotation marks.
Description
Use range parameter
If the number of bytes in a range is greater than the value in the list, Debug assigns a value repeatedly in the list until all bytes in the range are filled.
If any memory in the range is corrupted or does not exist, Debug displays the error message and stops the f command.
Use list Parameters
If the list contains more values than the number of bytes in the range, Debug ignores the additional values in the list.
Example
Run the following command:
F04ba: 100l100 42 45 52 54 41
In response, Debug uses the specified value to fill the memory position from 04BA: 100 to 04BA: 1FF. Debug repeats these five values until 100 h bytes are fully filled.
Debug: G (redirection)
Run the program in the memory.
G [= address] [breakpoints]
Parameters
= Address
Specifies the address of the program to be executed in the memory. If address is not specified, Windows 2000 runs the program from the current address in the CS: IP address Register.
Breakpoints
Specify 1 to 10 temporary breakpoints that can be set as part of the g command.
For information on execution cycles, repeated string commands, software interruptions, or subroutines, see Debug P (execution ).
For information on executing commands, see Debug T (Tracking)
Debug: H (hexadecimal)
Perform the hexadecimal operation on the specified two parameters.
H value1 value2
Parameters
Value1
Represents any hexadecimal number from 0 to FFFFh.
Value2
Represents the second hexadecimal number in the range from 0 to FFFFh.
Description
Debug first adds the specified two parameters, and then removes the second parameter from the first parameter. The calculation results are displayed in one row: Calculate the sum first, and then calculate the difference.
Example
Run the following command:
H19f 10a
Debug executes the operation and displays the following results.
02A9 0095
Debug: I (input)
Reads data from the specified port and displays a byte value.
I port
Parameters
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, see Debug O (output ).
Example
Run the following command:
I2f8
It is also assumed that the port's byte value is 42 h. Debug reads the byte and displays the value as follows:
42
Debug: L (load)
Load the content of a file or a specific disk sector to the memory.
To load the bytes specified in the BX: CX register from a disk file, use the following syntax:
L [address]
To skip the Windows 2000 file system and directly load a specific sector, use the following syntax:
L address drive start number
Parameters
Address
Specify the memory location where the file or slice content is to be loaded. If no address is specified, Debug uses the current address in the CS register.
Drive
The drive that contains the disk that reads the specified sector. This value is Numeric: 0 = A, 1 = B, 2 = C, etc.
Start
Specify the hexadecimal number of the first slice to load its content.
Number
Specify the hexadecimal number of consecutive slices to load. You can use the drive, start, and number parameters only when you want to load the content of a specific sector rather than the Files specified in the debug command line or the latest Debug n (name) command.
For information about the file used for the l command, see Debug n (name ).
For information on writing debugging files to the disk, see Debug w (write ).
Note:
Use the l command without Parameters
When the l command without parameters is used, the files specified on the debug command line will be loaded into the memory, starting from the address CS: 100. Debug sets the BX and CX registers as the number of loaded bytes at the same time. If you do not specify a file in the debug command line, the mounted file will be the file that is frequently specified by the recent n command.
Use the 1 command with the address Parameter
If you use the l command with the address parameter, Debug will load the file or the content of the specified sector from the memory location address.
Use the l command with all parameters
If you use the l command with all parameters, Debug loads the content of the specified disk sector instead of the file.
Load content of a specific slice
Each sector within the specified range is read from drive. Debug is loaded from start until all the content in the specified number of slice is loaded.
Load the. exe file
Debug ignores the address parameter of the. exe file. If the. exe file is specified, Debug locates the file again to the load address specified in the title of the. exe file. Before the. exe file is loaded to the memory, the title itself is detached from the. exe file. Therefore, the size of the. exe file on the disk is different from that in the memory. If you want to check the entire. exe file, use different extensions to rename the file.
Open a hexadecimal File
Debug considers files with the. hex extension as hexadecimal files. Type an l command without parameters to load the hexadecimal file starting from the address specified in the hexadecimal file. If the entered l command contains the address parameter, Debug adds the specified address to the address found in the hexadecimal file to determine the start address.
Example
Run the following command to start Debug:
Nfile.com
Now you can type the l command to load File.com. Debug loads the file and displays the Debug prompt.
Assume that the content of the 109 (6Dh) Sector of the starting logical sector of 15 (0Fh) needs to be loaded to the memory with the starting address 04BA: 0100 from drive C. To do this, enter the following command:
L04ba: 100 2 0f 6d
Debug: M (mobile)
Copy the content in one memory block to another.
M range address
Parameters
Range
Specify the start and end addresses, or the start address and length of the memory area of the content to be copied.
Address
Specifies the starting address for copying the range content to this location.
Description
Impact of replication on existing data
If the new data is not written to the address of the data block being copied, the source data remains unchanged. However, if the target block already contains data (just as it is in the overwriting copy operation), the data will be rewritten. (Overwriting a copy operation refers to an operation where the content of the target data block overwrites the content of the original data block .)
Overwrite Replication
Run the m command to overwrite the replication operation of the target address without losing data. Copy the modified address content first. Therefore, if you copy data from a higher address to a lower address, the copy operation starts from the lowest address of the original block and proceeds to the highest address. If you want to copy data from a low address to a high address, the copy operation starts from the highest address of the original block and starts from the lowest address.
Example
Run the following command:
Mcs: 100 110 cs: 500
Debug first copies the content in the CS: 110 address to the address CS: 510, and then copies the content in the CS: 10F address to the CS: 50F address until the CS: copy the content from the address 100 to the address CS: 500. To view the results, run the Debug d (dump) command and run the m command to specify the target address.
Debug: N (name)
Specify the name of the executable file of the Debug l (load) or w (write) command, or specify the parameters of the executable file being debugged.
N [drive:] [path] filename
To specify the parameters of the executable file for the test, use the following syntax:
N file-parameters
Parameters
If no parameter is available, the n command clears the current specification.
[Drive:] [path] filename
Specifies the location and name of the executable file to be tested.
File-parameters
Specify parameters and switches for the executable files being tested.
For information about loading files or specified disk sectors to memory, see Debug L ).
For information on writing debugging files to the disk, see Debug W (write ).
Description
Two Functions of the n command
You can use the n command in two ways. First, you can use it to specify the files used by the subsequent l (load) or w (write) commands. If you start Debug without naming the Debug file, you must use the nfilename command before loading the file using the l command. In CS: 5C, correct file name format for the file control block (FCB. Second, you can use the n command to specify the command line parameters and switches of the file to be debugged.
Memory Area
The following four memory regions are affected by the n command:
Memory location
Content
CS: 5C
File control data block (FCB) of file 1)
CS: 6C
File control data block (FCB) of file 2)
CS: 80
N command line length (in characters)
CS: 81
The start of n Command Line Characters
The first file name specified for the n command is placed in FCB of CS: 5C. If the second file name is specified, this name will be placed in FCB of CS: 6C. N the number of characters entered on the command line (n except the first character) is stored at Location CS: 80. The actual characters on the n command line (again, except the letter n) are stored at the position starting with CS: 81. Note that these characters can be any switches and delimiters that are valid in the Command entered at the Windows 2000 command prompt.
Example
Assume that Debug has been started and the program Prog.com being debugged has been loaded. Then you decide to specify two parameters for Prog.com and run the program. The command sequence of this example is as follows:
Debug prog.com
Nparam1 param2
G
In this case, the Debug g (redirection) Command will run the program, as if you have entered the following command at the Windows 2000 Command Prompt:
Prog param1 param2
Therefore, testing and debugging reflect the normal runtime environment of Prog.com.
In the following command sequence, the first n command specifies File1.exe as the followed l (load) command file, which loads File1.exe to the memory. The second n command specifies the parameter that File1.exe will use. Finally, the g command will run the File1.exe file, as if you typed 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 in the second form of the n command. Note that if you use the w (write) command, Windows 2000 will use the name File2.dat to save the file File1.exe being debugged. To avoid this result, the first form of the n command should always be used immediately before the l or w command.
Debug: O (output)
Send the byte value to the output port.
O port byte-value
Parameters
Port
Specify the output port through the 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 the input port, see Debug I (input ).
Example
To send the 4Fh byte value to the output port with the address of 2F8h, type the following command:
O2f8 4f
Debug: P (execution)
Executes loops, repeated string commands, software interruptions, or subroutines, or traces through any other commands.
P [= address] [number]
Parameters
= Address
Specifies the location of the first command to be executed. If no address is specified, the default address is the current address specified in the CS: IP Address Register.
Number
Specifies the number of commands to be executed before the control is returned to Debug. The default value is 1.
For information on running programs in the memory, see Debug G ).
For information on executing commands, see Debug T (Tracking ).
Description
Control Transfer to program to test
When the p command transfers control from Debug to the program to be tested, the program runs continuously until the loop, repeated string commands, software interruptions, or child routines with the specified address are completed, or until a specified number of machine commands are executed. Control Returns to Debug.
Address parameter restrictions
If the address parameter does not specify a segment, Debug uses the CS register of the tested program. If address is omitted, the program runs from the address specified in the CS: IP address Register. The equal sign (=) must be used before the address parameter to distinguish it from the number parameter. If the commands at the specified address are not cyclic, repeated string commands, software interruptions, or subroutines, the p command works the same as the Debug t (TRACE) command.
Emails displayed using the p command
After p executes a description, Debug displays the register content of the program, the flag status, and the decoding form of the next instruction to be executed.
Warning
You cannot use the p command to trace the read-only memory (ROM ).
Example
Assume that the program being tested contains a call command at address CS: 143F. To run the subroutine at the target location of the call and return the control to Debug, type the following command:
P = 143f
Debug displays 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)
Stop the Debug session and do not save the files currently tested.
After you type q, the control returns to the DOS command prompt.
Q
Parameters
This command does not contain parameters.
For information on saving files, see Debug W (write ).
Debug: R (Register)
Displays or changes the content of one or more CPU registers.
R [register-name]
Parameters
None
If no parameter is available, the r command displays the content of all registers and the flag in the register storage area.
Register-name
Register name of the content to be displayed.
For information on displaying part of the memory, see Debug D (dump ).
For information on disassembly bytes, see Debug U (disassembly ).
Description
Use the r command
If the register name is specified, Windows 2000 displays the 16-bit value of the Register marked in hexadecimal notation, and displays the colon as a prompt. To change the value included 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 of register-name: ax, bx, cx, dx, sp, bp, si, di, ds, es, ss, cs, ip, pc, and f. Both the ip address and the pc instance reference the instruction pointer.
If the register name is specified instead of from the previous list, Windows 2000 displays the following message:
Br error
Use the f character instead of the register name
If you enter the f character instead of the register name, Debug displays the current settings of each tag as two-letter code and then displays the Debug prompt. To change the flag settings, enter the appropriate two-letter code from the following table:
Flag name
Set
Clear
Overflow
Ov
Nv
Direction
Dn (minus)
Up (ADD)
Interrupted
Ei (Enabled)
Di (disabled)
Positive and Negative
Ng (negative)
Pl (positive)
Zero
Zr
Nz
Secondary carry
Ac
Na
Parity
Pe (even verification)
Po (odd check)
Carry
Cy
Nc
You can enter a new flag value in any order. No space is required between these values. To stop the r command, press ENTER. Any flag that does not specify a new value remains unchanged.
Emails displayed using the r command
If multiple values are specified for the tag, Debug displays the following message:
Df error
If no flag code is specified in the preceding table, Debug displays the following message:
Bf error
In both cases, Debug ignores all settings specified after the invalid project.
Default Debug settings
When debugging is started, the segment register is set to the low end of the idle memory, the instruction pointer is set to 0100 h, all flags are cleared, and the remaining registers are set to zero, in addition to the sp set to FFEEh.
Debug: R
Example
To view the content of all registers, the status of all tags, and the Instruction Decoding table at the current position, type the following command:
R
If the current location 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 the flag, enter 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, with or without 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 the changes, enter the r or rf command. Debug displays the following content:
Nv up ei pl nz ac pe cy -_
Press ENTER to return to the Debug prompt.
Debug: S (Search)
Searches for one or more byte values in an address range.
S range list
Parameters
Range
Specify the start and end addresses of the search range.
List
Specify the mode of one or more byte values or the string to be searched. Use spaces or commas to separate each byte value from the next byte value. Enclose string values in quotation marks.
Description
If the list parameter contains multiple byte values, Debug only displays the first address of the byte value. If the list contains only one byte value, Debug displays all addresses with this value within the specified range.
Example
Suppose you need to find all the addresses that contain a value of 41 and range from CS: 100 to CS: 110. To do this, enter the following command:
Scs: 100 110 41
Debug displays results in the following format:
04BA: 0104
04BA: 010D
-
The following command searches for the string "Ph" in the range from CS: 100 to CS: 1A0 ".
Scs: 100 1a0 "Ph"
Debug: T (Tracking)
(SORRY, Debug: T part is missing. If any user has this part, please let me know)
AoGo supplement:
The number of specified codes executed starting from the current segment address. The values of all registers (including Mark registers) are displayed each time the code is executed.
For example, t 10
Assuming that the current status is CS: 100, 10 lines of code will be executed starting from CS: 100, and the changes in the register after each line of code is executed will be displayed .)
Debug: U (disassembly)
Disassemble the byte and display the corresponding original statement, including the address and byte value. The disassembly code looks like a list of compiled files.
U [range]
Parameters
None
If no parameter is available, the u command is divided into 20 h bytes (default), starting from the first address after the address displayed by the preceding u command.
Range
Specifies the start address and end address of the Code to be decompiled, or the start address and length.
For information on integrated memory codes, see Debug A (assembly ).
For information on displaying part of the memory, see Debug D (dump ).
Example
To disassemble 16 (10 h) bytes, starting from address 04BA: 0100, type the following command:
U04ba: 100l10
Debug displays 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 only information from 04BA: 0100 to 04BA: 0108 is displayed, enter the following command:
U04 BA: 0100 0108
Debug displays the following content:
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 (write)
AoGo: it is only valid for COM, because EXE carries relocation information, while Debug cannot generate relocation information, so it cannot be written into EXE.
Write files or specific partitions to the disk.
To write the specified number of bytes in the BX: CX register to a disk file, use the following syntax:
W [address]
To skip the Windows 2000 file system and directly write data to a specific sector, use the following syntax:
W address drive start number
Parameters
Address
Specifies the starting memory address of the file or part of the file to be written to the disk. If address is not specified, the Debug program starts from CS: 100.
Drive
Specify the drive that contains the target disk. The value is Numeric: 0 = A, 1 = B, 2 = C, and so on.
Start
Specify the hexadecimal number of the first slice to be written.
Number
Number of sectors to be written.
For information about the file used for the w command, see Debug N (name ).
For information on loading file or file sector content to memory, see Debug L (loading ).
Description
The name of the disk file must be specified at Debug startup or in the latest Debug n (name) command. Both methods can arrange the file name of the file control block at the address CS: 5C in a correct format.
Reset BX: CX before using the w command without Parameters
If the Debug g (steering), t (tracing), p (execution), or r (Register) command is used, you must run the BX: CX register reset.
Write the modified file to the disk.
If you modify the file but do not change the file name, length, or start address, Debug still correctly writes the file to the source disk location.
W command restrictions
You cannot use this command to write. exe or. hex files.
Warning
It is dangerous to write a specific partition because the file handle of Windows 2000 is skipped. If an incorrect value is entered, the disk file structure is easily damaged.
Example
Suppose you want to write the memory content starting with CS: 100 to the disk of drive B. Data needs to start from the logical sector number 37 h of the disk and continue for 2Bh sectors. To do this, type the following command:
Wcs: 100 1 37 2b
After the write operation is complete, Debug displays the Debug prompt again.
Debug: XA (allocating extended memory)
Specify the number of pages for allocating extended memory.
To use extended memory, you must install an extended memory device driver that complies with Lotus/Intel/Microsoft extended memory specifications (lim EMS) of Version 4.0.
Xa [count]
Parameters
Count
The number of 16 KB pages of the extended memory to be allocated.
For more information about other Debug commands that use extended memory, see Debug XD (release extended memory), Debug XM (ing extended memory page), or Debug XS (display extended memory status ).
Description
If the specified page number is available, Debug displays the message, which indicates the hexadecimal number of the created handle. Otherwise, Debug displays the error message.
Debug: XA
Example
To allocate 8 pages of extended memory, type the following command:
Xa8
If the command is successful, Debug displays the following message:
Handle created = 0003
Debug: XD (release extended memory)
Release the handle pointing to the extended memory.
To use extended memory, you must install an extended memory device driver that complies with Lotus/Intel/Microsoft extended memory specifications (lim EMS) of Version 4.0.
Xd [handle]
Parameters
Handle
Specifies the handle to release.
For more information about using other Debug commands for extended memory, see Debug XA (allocating extended memory), Debug XM (ing extended memory page), or Debug XS (displaying the extended memory status ).
Example
To release the handle 0003, type the following command:
XSS 0003
If the command is successful, Debug displays the following message:
Hdle 0003 deallocated
Debug: XM (ing extended Memory Page)
Maps the extended memory logic page of the specified handle to the physical page of the extended memory.
To use extended memory, you must install an extended memory device driver that complies with Lotus/Intel/Microsoft extended memory specifications (lim EMS) of Version 4.0.
Xm [lpage] [ppage] [handle]
Parameters
Lpage
Specifies the logical page number of the extended memory to be mapped to the physical page ppage.
Ppage
Specifies the physical page number mapped to the lpage.
Handle
Specify the handle.
For more information about using other Debug commands for extended memory, see Debug XA (allocating extended memory), Debug XD (releasing extended memory), or Debug XS (displaying extended memory ).
Example
To map logical page 5 of handle 0003 to physical page 2, type the following command:
Xm 5 2 0003
If the command is successful, Debug displays the following message:
Logical page 05 mapped to physical page 02
Debug: XS (display extended memory status)
Displays the extended memory status.
To use extended memory, you must install an extended memory device driver that complies with Lotus/Intel/Microsoft extended memory specifications (lim EMS) of Version 4.0.
Xs
Parameters
This command does not contain parameters.
For more information about using other Debug commands for extended memory, see Debug XA (allocating extended memory), Debug XD (releasing extended memory), or Debug XM (ing extended memory page ).
Description
The information displayed by Debug is in 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, enter 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 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