Debug.com is a small program supplied with DOS that allows
the user to load a program and examine the machine code, the assembly code,
or to write small programs. Debug allows you to change small programs and
to run them by tracing through each instruction while observing the results.
Don't have DOS or debug? Get them.
Debug is simple. Debug is cheap. Debug is very useful for small jobs.
Debug is a good place to start learning assembly language programming.
Small programs can be written and run in a few minutes and the results
observed, The inter workings of the microprocessor can be mastered by direct
observation.
I have observed that top students keep debug handy even after they have
more expensive and comprehensive debugger programs available.
We will learn debug.com first and use it to explore assembly language
commands. The first step is to learn the debug commands. It is suggested
that you keep the command list handy at first. Soon there will be no need
for it.
You can start debug by typing the word debug at the DOS command prompt.
The debug prompt will appear. It is a dash and ordinary cursor.
-_
Here is a list of the debug commands in summary form:
- Register --------- R - display the register content
- Dump ----------- D - dump memory content
- Enter ------------ E - enter data
- Name ----------- N - name the program to be saved
- Load ------------ L - load a program from disk
- Go --------------- G - run the program you have loaded
- Assemble ------- A - assemble program with the DEBUG assembler
- Unassemble ---- U - unassemble the program showing assembly code
- Write ----------- W - write the named program to disk
- Trace ----------- T - trace through code one instruction at a time
- Proceed --------- P - proceed through an interrupt - used with trace
The next few pages contain details about the use of these
commands. Try them all. Master them and you will have a valuable programming
tool. CAUTION! Don't strike keys to see what will happen. Don't let the
baby play with debug. Don't let the cat run across the keyboard. It is
possible to write junk to any place on the hard drive.
By Bob Harrell