Help us understand the problem. What is going on with this article?

debugコマンド(MS DOS)

More than 1 year has passed since last update.

debug命令

MS-DOSにはdebugコマンドがあった。
データの表示(dump)、
データの入力、
アセンブラの入力、
ディスアセンブル、
デバッグ用のブレークポイントの設定など、
何種類もの機能がある万能の道具だった。

16bitアプリケーションということで、64bit Windowsには同梱されていない。
こんな便利な道具がなくなるなんて悲しい。

ぜひ、みんなが便利さを理解して、
debugコマンドの再興を願い記録する。

ダンプ(d)

メモリの中身を、16進数とテキストデータにして表示

> debug abc.txt
-d 100
2C98:0100  61 62 63 64 65 66 67 68-69 6A 6B 6C 6D 6E 6F 70   abcdefghijklmnop
2C98:0110  71 72 73 74 75 76 77 78-79 7A 2C 2E 3B 2F 0D 0A   qrstuvwxyz,.;/..
2C98:0120  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
2C98:0130  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
2C98:0140  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
2C98:0150  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
2C98:0160  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
2C98:0170  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................

アセンブル(a)

アセンブリ言語を入れるとバイナリ命令に変換する。

>debug
-a 0000
2CED:0000 pop ds
2CED:0001 push cs
2CED:0002
-u 0
2CED:0000 1F            POP     DS
2CED:0001 0E            PUSH    CS

ディスアセンブル(u)

バイナリ命令をアセンブリ言語に変換する

>debug wordpad.exe
-u
2CED:0000 0E            PUSH    CS
2CED:0001 1F            POP     DS
2CED:0002 BA0E00        MOV     DX,000E
2CED:0005 B409          MOV     AH,09
2CED:0007 CD21          INT     21
2CED:0009 B8014C        MOV     AX,4C01
2CED:000C CD21          INT     21
2CED:000E 54            PUSH    SP
2CED:000F 68            DB      68
2CED:0010 69            DB      69
2CED:0011 7320          JNB     0033
2CED:0013 7072          JO      0087
2CED:0015 6F            DB      6F
2CED:0016 67            DB      67
2CED:0017 7261          JB      007A
2CED:0019 6D            DB      6D
2CED:001A 206361        AND     [BP+DI+61],AH
2CED:001D 6E            DB      6E
2CED:001E 6E            DB      6E
2CED:001F 6F            DB      6F

デバッグ用ブレーク(b)

参考資料(reference)

MacintoshでMS-DOSのdebugコマンドの動作確認をするのにどうしたらいいか悩んでいた。
https://qiita.com/kaizen_nagoya/items/206eb5b219f2b65514de

文書履歴(document history)

ver 0.10 初稿 20180703
ver 0.11 参考文書追記 20180716

kaizen_nagoya
I'm a network designer.I work on TOPPERS SmallestSetProfile Kernel,MISRA-C, STARC RTL Design StyleGuide (Verilog-HDL),HAZOP,ISO/IEC15504(AutomotiveSPICE),ISO26262. I was an editor on ISO/IEC 15504.
https://researchmap.jp/blogs/blog_entries/view/81777/f691323917cc4ea12caf0b03b34c8ea0?frame_id=442673
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした