Batching Debug instruction



Batch files, using the Command.Com is covered in another section. In review, instructions may be redirected from a text file to execute the commands normally expected from the operator on the keyboard.

This presentation will use bat files to demonstrate the remaining Debug functions. It permits us to type in the set of Debug instructions only once, or to copy and paste the instructions for use in a batch stream.

Format a Floppy Disk and copy these files from the Hard Drive onto it. Format a System Disk for Windows systems prior to XP. Create a data disk for Windows XP and later systems.
 
Command.com
GWBasic.exe
Debug.exe

This makes it easy to ensure that any files sent to the disk with these programs will go into the current device (the flopy disk) and not into some location on the hard drive where I will have difficulty locating and deleting them later. . It will also ensure that the less limited earlier systems don't inadvertantly alter the Hard Drive's boot sector.
SAFETY and GOOD HOUSEKEEPING.



Batching the instructions for Debug

Two more files will be added to the Floppy Disk in this exercise. Their functions will be explained in detail.

Create a text file on the Floppy Disk and re-name it to BATCHING.BAT containing the following text.
a:debug < a:batching.txt
pause

Create a second text file on the Floppy Disk named BATCHING.TXT containing the folling text.
?
q


The COMMAND.COM program is our Command Line Interpreter. It runs the entire show. It has the ability to use the commands in a Batch file instead of requiring an operator to type in each command to perform our task.
The BATCHING.BAT file, provides two commands to the interpreter, The first instruction is to call the Debug program, redirecting its input from a text file rather than from the keyboard.
The BATCHING.TXT provides the Debug instructions necessary to perform the task.




Executing our program

Our batch file is intended to provide the same information as was displayed in our earlier examples using the command line interpreter. Open the Floppy Disk with Windows. Open the Command Interpreter by double clicking on the COMMAND.COM icon. The DOS PROMPT console window will invite a command an entry from the keyboard with the familiar A:\> prompt.
Type BATCHING and press ENTER. The DOS console will show the folling display and wait for "any key" to return to the command line interpreter's DOS prompt for additional instructions.



assemble     A [address]
compare      C range address
dump         D [range]
enter        E address [list]
fill         F range list
go           G [=address] [addresses]
hex          H value1 value2
input        I port
load         L [address] [drive] [firstsector] [number]
move         M range address
name         N [pathname] [arglist]
output       O port byte
proceed      P [=address] [number]
quit         Q
register     R [register]
search       S range list
trace        T [=address] [value]
unassemble   U [range]
write        W [address] [drive] [firstsector] [number]
allocate expanded memory        XA [#pages]
deallocate expanded memory      XD [handle]
map expanded memory pages       XM [Lpage] [Ppage] [handle]
display expanded memory status  XS
-q

A:\>pause
Press any key to continue . . .







Summary

This demonstration is very simplistic, intended to illustrate the usefulness for Batch files with Debug. Very elaborate Batch streams can be run using the same technique. All that is necessary is to put other Debug commands into the text file that is to be used by Debug to perform our task. Saves much typing and reduces the likelihood of typos.

This technique can also be used to run script under Windows from the Hard Drive, but that is not our intention in this exercise. Once the techniques are understood, It is a very powerful tool, both under Windows and as a stand alone set of programs.

For example, this demonstration could have been executed from Windows without opening Command.Com from the Floppy Disk by clicking START, RUN, entering A:batching and click on OK.

Its not even necessary to call the command interpreter to execute this Batch stream. All that is necessary, Under Windows is to double click on the Batching.bat icon on the Floppy Disk. However, for the sake of later examples, we have called our bat stream from the DOS prompt in this example.

However, for our example, it is intended to demonstrate the use of batch files in its simplest form. This is a Debug demonstration, not a DOS or BATCH demo. For a better understanding of Batch Programming and DOS instructions, please review the section on these subjects.