China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 15:49
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » [Original] Detailed Explanation of dr-debug Usage DigestI View 5,004 Replies 8
Original Poster Posted 2003-02-14 00:00 ·  中国 北京 海淀区 教育网
初级用户
wolfwood
Credits 158
Posts 14
Joined 2003-02-14 00:00
23-year member
UID 919
Gender Male
Status Offline
Detailed Explanation of debug

First of all, I would like to recommend using DR-DEBUG that comes with DR-DOS7. It supports instructions up to Pentium pro, is powerful, and supports macros. The most convenient thing is that you can use the Enter key to replace the previous u/d/p/t instruction, which is convenient for viewing and debugging.

The following is the translation of its help:

Assemble, convert the input assembly language into machine code
A (example: Acs:100)

Set breakpoints for debugging
B (example: B100 2 al=80)

Compare the contents of two segments of memory
Compare C range address (example: C200 20d 500)

Display the specified memory data
Dump D (example: Dcs:500 L 10)

Edit memory data
Enter E (example: Eds:500 "Hello ")

Fill memory
Fill F range data (example: F100 13f "Test ")

Run the program from the specified point
Go G (example: Gcs:4bb0)

Calculate
Hex H (example: H10e 01)

Input from I/O port
Input I port (example: I3f2)

Load the content of a file or a specified logical sector
Load L (ex: L0Cff 3 09 10)

Move (copy) the content of memory
Move M range address (example: Mcs:200 220 cs:400)

Specify the operation file name
Name N filename (example: Ntest.com)

Output to I/O port
Output O port value (example: O3ff 10)

Step through (skip int/rep/call, etc.)
Proceed P (example: P=ds:3fff)

Quit debug
Quit Q

Change or display registers
Register R (example: Rax 1000)

Search for data in the specified memory
Search S range data (example: Sds:200 500 32)

Step through (enter int/rep/call, etc.)
Trace T (example: T=3cff:0100 10)

Unassemble the machine code in the specified memory
Unassemble U (example: U3cff:0200 400)

Display the screen content (equivalent to)
Viewswap V (any key returns)

Write the content of a file or a specified logical sector
Write W (ex: Wds:200 0 16 0f)
(range can be: start offset end offset or start address L length)

The following are detailed usage instructions:
--- Glossary ---
pathname - File name (optional path)
testparms - Parameters
address - Memory address offset
If the segment address is omitted, CS is used for assembly/disassembly; DS is used for other functions
range - Can be: start offset end offset
start address L length
start address, + length
reg - Register name
list - Some values separated by spaces or commas (of a given type)

drive - 0 = A:, 1 = B:, ...
firstsec - Logical sector number (starting from 0)

--- Operators ---
Numbers can be hexadecimal (default), # decimal, \ octal, % binary, '' string '' ("chars"),
Registers, , ^ stack.
Operators (+ - * /) and (parentheses) can be used.
Example: Rax=(^ + (bl * %1001) + ''a'').

- represents basic debug commands
+ represents commands unique to dr-debug
x represents instructions that can only be executed in dr-debug extended mode. Enter /s to enter default mode, and enter /x to enter extended mode

--- Dump commands ---
-D x Set/query default display length (in bytes)
-DB x Set/query default display length and return in byte mode
D= x Set/query the start point of viewing (0-f)
D - Display the specified memory content (/S mode) / repeat the last D? command (/X mode)
DB - Display the specified memory content (in bytes)
DW x Display the specified memory content (in words)
DD x Display the specified memory content (in double words)
DP x Display the pointer of the specified memory (far pointer - segment: offset)
DI x Display the interrupt vector table (range = interrupt number)

--- Enter commands ---
(When the list is omitted, enter data after pressing Enter, "." to exit)
E ] + Enter data
EB] x Enter data (in bytes)
EW] x Enter data (in words)
ED] x Enter data (in double words)
EP] x Enter data (in far pointers)
EI] x Enter interrupt vector

--- Compare commands ---
C range,address - Compare the contents of two segments of memory
CBrange,address x Compare the contents of two segments of memory (in bytes)
CWrange,address x Compare the contents of two segments of memory (in words)
CDrange,address x Compare the contents of two segments of memory (in double words)
CPrange,address x Compare the contents of two segments of memory (in far pointers)

--- Fill commands ---
F range,list - Fill data into memory
FBrange,list x Fill data into memory (in bytes)
FWrange,list x Fill data into memory (in words)
FDrange,list x Fill data into memory (in double words)
FPrange,list x Fill data into memory (in far pointers)


--- Search commands ---
S address list - Search for data in the specified memory
-Saddress list x Search for data in the specified memory and save the offset address of the (cx+1)th match in cx
SBaddress list x Search for data in the specified memory (in bytes) (-SB is as before)
SWaddress list x Search for data in the specified memory (in words) (-SW is as before)
SDaddress list x Search for data in the specified memory (in double words) (-SD is as before)
SPaddress list x Search for data in the specified memory (in far pointers) (-SP is as before)

--- Port I/O commands ---
I port - Input from I/O port
IB port x Input from I/O port (in bytes)
IW port x Input from I/O port (in words)
ID port x Input from I/O port (in double words) (supported above 386)
O port,value - Output to I/O port
OB port,value x Output to I/O port (in bytes)
OW port,value x Output to I/O port (in words)
OD port,value x Output to I/O port (in double words) (supported above 386)

--- Macro commands ---
-: + Clear all macros
:macroname + Define macro
= + List macro or execute macro

--- Disk I/O commands ---
N - Release parameters for the next disk operation
N? + Display parameters
N
- Specify file
L - Load file
Laddress - Load file to the specified memory address
W - Write memory to file, starting from cs:100 with length BX-CX
W - Write memory to file, starting from the specified address with length BX-CX
Laddress,drive,firstsec,number
- Load the specified logical sector to the specified memory (num = number of sectors to load)
Waddress,drive,firstsec,number
- Save the specified memory to the specified logical sector (num = number of sectors to save, or use BX-CX to specify its length - in bytes)

--- Trace commands ---
-B x Clear all breakpoints (translated as breakpoint, the same below)
-Baddress x Clear the breakpoint at the specified address
B + List breakpoints
Baddress]
+ Set breakpoint at the specified memory, interrupt every count times, interrupt condition: reg=val
T - Step through starting from the specified address for number instructions
TU + Same as T, but do not display the execution result of intermediate instructions
P - Same as T, but skip call and int subroutines
PU + Same as P, but do not display the execution result of intermediate instructions
G Execute starting from the specified address (or CS:IP), stop at

--- Assemble command ---
A - Enter the input assembly language mode (press Enter/. to exit), support comments

--- Unassemble commands ---
-Unumber x Set/query default unassemble length
U - Unassemble the specified memory instructions

--- Help commands ---
? - Display basic help
?topic + Display specific topic or page number (1..8)
?? or ?0 + Display all help

--- Display and input modes ---
A= x Set/query default address mode (16-bit/32-bit)
O= x Set/query default operand mode (16-bit/32-bit)
R= + Set/query default register display mode (16-bit/32-bit)
RF - Set/query flag register
RDR x Display flag register in 16-bit register mode (default in /X mode)
RMS x Display flag register in standard mode (default in /S mode)

--- Utility commands ---
ASCII + Display an ASCII table
CLS + Clear screen
CPU + Display CPU type (support up to Pentium pro) and working mode (real mode/32-bit protected mode/virtual 86 mode)
H value + Display ''value'' in hexadecimal, decimal, character, octal and binary
H value1 value2 + Display the results of adding, subtracting, multiplying, dividing and taking modulus of value1 and value2
V + Display the user screen (execution result of the program, just like in c)
; comment + Comment






我不能偷也不能搶
Floor 2 Posted 2003-02-14 00:00 ·  中国 黑龙江 哈尔滨 联通
高级用户
★★
Credits 830
Posts 233
Joined 2002-11-29 00:00
23-year member
UID 364
Gender Male
Status Offline
Great! Then it can be downloaded! Need separate files!
┃ \\\\//// ┃通缉:杨小邪 特点:贼丑
┃ (-●●-) ┃年龄:刚成年 性别:男
┃ \ / ┃罪名:长的丑/总想见网友
┃ \︶/ ┃犯罪事实:吓死一片~
Floor 3 Posted 2003-02-14 00:00 ·  中国 北京 海淀区 教育网
初级用户
wolfwood
Credits 158
Posts 14
Joined 2003-02-14 00:00
23-year member
UID 919
Gender Male
Status Offline
Just download your own DR-DOS, and there are more powerful tools inside - taskmgr (multitask manager under DOS) and so on, but it can't be used on other DOSes, and there are quite a few protection measures inside, not so easy to crack. But someone has already cracked it long ago.
我不能偷也不能搶
Floor 4 Posted 2003-02-14 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
I used TASKMGR in DR-DOS, but it was very unstable and not practical.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 5 Posted 2003-02-15 00:00 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 327
Posts 69
Joined 2002-12-01 00:00
23-year member
UID 377
Gender Male
Status Offline
LZ, can you use simplified Chinese next time when posting an article? Your article makes my eyes hurt and is too difficult to read.
Floor 6 Posted 2003-02-15 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Is that so? When I read traditional Chinese, I actually feel quite accustomed to it, although I'm more accustomed to reading simplified Chinese.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 7 Posted 2003-02-16 00:00 ·  中国 北京 海淀区 教育网
初级用户
wolfwood
Credits 158
Posts 14
Joined 2003-02-14 00:00
23-year member
UID 919
Gender Male
Status Offline
Right, after reading a lot of books from the Commercial Press and Taiwanese documents, I really feel that traditional Chinese is more comfortable.
我不能偷也不能搶
Floor 8 Posted 2003-02-17 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Traditional Chinese is a treasure of China. Now it is used in all Chinese - speaking regions around the world except the Chinese mainland. The Chinese mainland began to use simplified Chinese more than 40 years ago.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 9 Posted 2003-02-18 00:00 ·  中国 安徽 滁州 天长市 电信
银牌会员
★★★
Credits 1,835
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
Hehe, it doesn't matter, as long as it can be understood.
Forum Jump: