中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-30 05:09
47,813 topics / 349,918 posts / today 0 new / 48,278 members
DOS学习入门 & 精彩文章 (教学室)  Moderators: ko20010214、zzz19760225
View digest  4,336 threads / 174 pages
Subject Author Replies / Views Last post
Reprint: Skills for Copying DOS Window Information MYS 19 / 5,423 2009-03-13 23:37
lxhwf
求DOS下U盘驱动及使用方法 liuyma 10 / 3,018 2009-03-12 23:58
wama
HWINFO503 reports “no enough memory” cyradg 2 / 1,935 2009-03-11 22:20
gund
[求书] 各位请进! bbgeek 0 / 1,015 2009-03-08 16:06
bbgeek
What does "lh" mean? zzhh612 7 / 14,266 2009-03-08 07:44
tongtong2009
cpu使用100% cjhpower 4 / 1,461 2009-03-08 07:09
fujianabc
求if比较全的文章 lserfn 5 / 2,125 2009-03-08 01:33
5566ljlj
怎么在VMware下安装MS-DOS wf2030 5 / 1,390 2009-03-07 11:30
djp2001
哈哈,自己翻译的cp/m系统的命令 machill 9 / 1,883 2009-03-07 03:34
5566ljlj
请教DOS详细U盘安装法 zhongsiyu 3 / 1,410 2009-03-04 11:55
crazii
[Help] Installation problem with the MS-DOS 7.10 full installation edition rouxiao 0 / 1,053 2009-02-26 22:02
rouxiao
为 Vista 添加 DOS Qtwdftxvt 12 / 1,672 2009-02-26 06:42
tianxingren
Can config.sys set up a second-level menu? hotdog 8 / 2,019 2009-02-26 00:30
wangking2008
DOS入门教程chm[下载] (Closed thread) 睡呆了 11 / 2,319 2009-02-21 22:56
huwentao000
Classic DOS Textbook (Must-Read for DOS Beginners) (Closed thread) mictownar 48 / 10,918 2009-02-21 22:51
huwentao000
关于cp/m的命令 machill 3 / 1,044 2009-02-18 23:03
machill
问一下,Ghost.exe用于商业恢复安装license怎么购买 helloxpe 6 / 1,474 2009-02-15 22:03
zhxy9804
我想学DOS可不知从哪里入手想请大家帮下我 zyx 10 / 1,664 2009-02-14 22:08
wangfangjian
如何理解这个是什么意思? zhoudf 7 / 1,558 2009-02-14 06:22
VAF
[Original] MS-DOS 6 Command Encyclopedia: Entered from 2008-02 to 2008-12 sunenze 11 / 2,163 2009-02-14 05:06
ql08421032
### 一、Debug简介 Debug是DOS系统下的一个强大的调试工具,它可以用来调试程序、查看内存、跟踪程序执行等。 ### 1. Debug的启动 在DOS提示符下输入`debug`命令即可启动Debug。例如: ``` C:\>debug ``` 启动后会进入Debug的命令行界面,显示`-`提示符。 ### 二、常用Debug命令 #### 1. R命令 - 查看和修改寄存器内容 - **查看寄存器内容**:输入`r`命令,会列出所有寄存器的当前值。例如: ``` -a MOV AX,1234 MOV BX,5678 INT 20H -r AX=0000 BX=0000 CX=0000 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000 CS=075C DS=075C ES=075C SS=075C IP=0000 NV UP EI PL NZ NA PO NC 075C:0000 B83412 MOV AX,1234 ``` - **修改寄存器内容**:例如要修改AX寄存器的值为`5555`,可以输入`r ax`,然后输入`5555`,回车后AX寄存器的值就被修改为`5555`。 #### 2. D命令 - 查看内存内容 - **格式**:`d [地址范围]` - **示例**:查看内存地址从`0B800:0000`开始的16个字节的内容,输入`d 0b80:0000` ``` -d 0b80:0000 0B80:0000 F04F 0700 F04F 0700-F04F 0700 F04F 0700 O.......O.......O.... 0B80:0010 0000 0000 0000 0000-0000 0000 0000 0000 ................ ``` #### 3. E命令 - 编辑内存内容 - **格式**:`e [地址] [字节1] [字节2]...` - **示例**:将内存地址`0000:0100`处的字节修改为`12`和`34`,输入`e 0:100 12 34` #### 4. U命令 - 反汇编 - **格式**:`u [地址范围]` - **示例**:反汇编从地址`075C:0000`开始的内容,输入`u 075c:0000` ``` -u 075c:0000 075C:0000 B83412 MOV AX,1234 075C:0003 CD20 INT 20H ``` #### 5. T命令 - 单步执行 - **格式**:`t [步数]`,如果不指定步数,默认执行1条指令 - **示例**:从当前指令开始单步执行1条指令,输入`t` ``` -t AX=1234 BX=0000 CX=0000 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000 CS=075C DS=075C ES=075C SS=075C IP=0003 NV UP EI PL NZ NA PO NC 075C:0003 CD20 INT 20H ``` #### 6. A命令 - 汇编 - **格式**:`a [地址]`,如果不指定地址,从当前IP指向的地址开始汇编 - **示例**:输入`a`后,会进入汇编状态,逐行输入汇编指令,输入完后按Ctrl + C结束 ``` -a 075C:0000 MOV AX,1234 075C:0003 INT 20H ^C ``` ### 三、Debug调试程序示例 以一个简单的汇编程序为例,编写一个将`AX`寄存器的值设置为`1234`并终止程序的程序。 1. 用文本编辑器编写汇编代码,保存为`test.asm`,代码如下: ```asm MOV AX,1234 INT 20H ``` 2. 用MASM汇编该文件得到`test.obj`,再用LINK链接得到`test.exe`。 3. 在DOS下用Debug调试`test.exe`,输入`debug test.exe` 4. 用`u`命令反汇编查看程序: ``` -u 075C:0000 B83412 MOV AX,1234 075C:0003 CD20 INT 20H ``` 5. 用`t`命令单步执行,观察寄存器变化等情况。 以上就是Debug的基本教程,通过这些命令可以对程序进行调试和分析。The complete tutorial of Debug ### 1. Introduction to Debug Debug is a powerful debugging tool under the DOS system. It can be used to debug programs, view memory, track program execution, etc. ### 1. Startup of Debug Enter the `debug` command at the DOS prompt to start Debug. For example: ``` C:\>debug ``` After startup, it will enter the command line interface of Debug, displaying the `-` prompt. ### 2. Commonly used Debug commands #### 1. R command - View and modify register contents - **View register contents**: Enter the `r` command, and all register values will be listed. For example: ``` -a MOV AX,1234 MOV BX,5678 INT 20H -r AX=0000 BX=0000 CX=0000 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000 CS=075C DS=075C ES=075C SS=075C IP=0000 NV UP EI PL NZ NA PO NC 075C:0000 B83412 MOV AX,1234 ``` - **Modify register contents**: For example, to modify the value of the AX register to `5555`, you can enter `r ax`, then enter `5555`, and press Enter to modify the value of the AX register to `5555`. #### 2. D command - View memory contents - **Format**: `d [address range]` - **Example**: To view the contents of 16 bytes starting from the memory address `0B800:0000`, enter `d 0b80:0000` ``` -d 0b80:0000 0B80:0000 F04F 0700 F04F 0700-F04F 0700 F04F 0700 O.......O.......O.... 0B80:0010 0000 0000 0000 0000-0000 0000 0000 0000 ................ ``` #### 3. E command - Edit memory contents - **Format**: `e [address] [byte 1] [byte 2]...` - **Example**: Modify the bytes at the memory address `0000:0100` to `12` and `34`, enter `e 0:100 12 34` #### 4. U command - Disassemble - **Format**: `u [address range]` - **Example**: Disassemble the contents starting from the address `075C:0000`, enter `u 075c:0000` ``` -u 075c:0000 075C:0000 B83412 MOV AX,1234 075C:0003 CD20 INT 20H ``` #### 5. T command - Single - step execution - **Format**: `t [number of steps]`. If the number of steps is not specified, 1 instruction is executed by default - **Example**: Single - step execute 1 instruction starting from the current instruction, enter `t` ``` -t AX=1234 BX=0000 CX=0000 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000 CS=075C DS=075C ES=075C SS=075C IP=0003 NV UP EI PL NZ NA PO NC 075C:0003 CD20 INT 20H ``` #### 6. A command - Assemble - **Format**: `a [address]`. If the address is not specified, assembly starts from the address pointed to by the current IP - **Example**: Enter `a`, and it will enter the assembly state. Input assembly instructions line by line. After inputting, press Ctrl + C to end ``` -a 075C:0000 MOV AX,1234 075C:0003 INT 20H ^C ``` ### 3. Example of Debug debugging program Take a simple assembly program as an example. Write an assembly program that sets the value of the `AX` register to `1234` and terminates the program. 1. Write assembly code with a text editor, save it as `test.asm`, and the code is as follows: ```asm MOV AX,1234 INT 20H ``` 2. Assemble this file with MASM to get `test.obj`, and then link it with LINK to get `test.exe`. 3. Debug `test.exe` under DOS, enter `debug test.exe` 4. Use the `u` command to disassemble and view the program: ``` -u 075C:0000 B83412 MOV AX,1234 075C:0003 CD20 INT 20H ``` 5. Use the `t` command to single - step execute and observe the register changes and other situations. The above is the basic tutorial of Debug. Through these commands, programs can be debugged and analyzed. dongbaoyuan 7 / 1,824 2009-02-14 01:36
upcjinjin
[求助]求国外DOS论坛、网站地址 leopardsaga 1 / 1,327 2009-02-13 23:12
HAT
我已下载了ms-dos7.10完全安装版本但是不能安装 Nofox 0 / 1,209 2009-02-13 13:52
Nofox
Who knows the usage of the redirection commands < and << in Dos? qingteng1983 9 / 2,283 2009-02-12 22:35
pujihong123
****关于批处理的一个问题 wangzhuoh8 3 / 1,173 2009-02-12 19:24
cc475178329
Prev  1 … 15 16 17 18 19 20 21 … 174  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023