It is not necessary to write the comments which go after the ";". Once the last command has been typed, int 20, <Enter> is pressed without writing anything more, to see the Debugger prompt again.
The last written line is not properly an assembler Instruction, instead it is a call for an operative system interruption, these interruptions save us a great deal of lines and are very useful to access operative system functions.
To execute the program we wrote, the "g" command is used, and when used we will see a message that says:
"Program terminated normally". Naturally with a message like this one we can not be sure the program has done the addition, but there is a simple way to verify it, by using the "r" command of the Debug we can see the contents of all the registers of the processor, simply type:
Each register with its respective actual value will appear on the screen like this:
AX=0006 BX=0004 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=0C1B ES=0C1B SS=0C1B CS=0C1B IP=010A NV UP EI PL NZ NA PO NC
0C1B:010A OF DB
The possibility that the registers contain different values exists, but AX and BX must be the same, since they are the ones we just modified.
Another way to see the values, while the program is executed, is to use the address where we want the execution to end and show the values of the registers as a parameter for "g", in this case it would be: g108, this Instruction executes the program, it stops on the 108 address and shows the contents of the registers.
A follow up of what is happening in the registers can be done by using the "t" command (trace), the function of this command is to execute line by line what was assembled, showing each time the contents of the registers.
To exit Debug use the "q" (quit) command.
Advantages of the Assembler
The first reason to work with assembler is that it provides the opportunity of knowing more the operation of your PC, which allows the development of software in a more consistent manner.
The second reason is the total control of the computer, which you can have with the use of the assembler. Another reason is that the assembly based programs are quicker and in some cases they are smaller, and have larger capacities than ones created with other languages.
Let me keep my promise!!
In the earlier part of this chapter we were using some instructins as example, to make the backup of DBR and to load the backup of DBR to its original location when it is needed. First we examine the Instruction to make the backup.
C:\>DEBUG A:\BKDBR.BIN <Enter>
File not found
- L 100 2 0 1 <Enter>
- R CX <Enter>
: 200 <Enter>
- W <Enter>
Writing 00200 bytes
- Q <Enter>
|Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Publishers of the Book
Number of Pages
Price of the Book
BPB Publications, New Delhi, India
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)