DEDICATED DEBUGGING TOOL(s) 

Copyright ABnormal Enterprises Inc © 1999

(To return to download window, click on an Icon above)
 
 

Command Window

Overview:

The Dedicated Debugging Tool (DDT) is for the user that wants to keep bugs out of his/her assembler programs.
 
 

A full screen debugging tool, DDT captures the interrupt vectors and allows users to enter in a number of ways. By setting breakpoints using DDT’s own tools, using the trap flag, embedding Int 3 instructions … or even the Print screen key; the user is able to view instructions, registers and/or memory as the users program executes..

On interrupt, the user video data is captured and the DDT display is invoked. In simple keyword style, registers and variables may be inspected and modified, similar to DEBUG but the full screen format, and intuitive aids assist in streamlining the debugging process.

Written using NASM and Nasm-IDE, it is the perfect complement to those tools. As I could not find a free full screen debugging tool on the web, I wrote one as an aid for my work on something else.. Also this is my working document. Functions and commands I am working on are highlighted in PINK and are not available YET !

One other thing. Yes, AEInc is sensitive to environmental issues and does support a worldwide ban on persistent chemicals. As a bug killer, here in cyber space, we just could not resist the name. In real life, the way to kill bugs is to be nice to the frogs!!!

Caveats:

Developed for use with NASM, it is offered as freeware with the following restrictions.

You are free to use the software, without modification or elimination of the author and copyright notice.

  As the software has built in obsolescence dates, please don’t distribute your copy, but rather refer others to the web site to pick up the latest version.

  Don’t defeat the obsolescence mechanism… although it is not difficult. This gizmo is always under development, and I just want others to have the latest version … its not a big download file.. And what the heck … it is free.

  There is no warranty expressed or implied. If you use this gizmo to enter bad variables, destroy storage, munch the operating system or your hard drive…. I don’t want the credit.

Invoking:

The utility is invoked without parameters It functions as a resident debugging tool and stays resident for as long as that DOS machine is not rebooted or the MsDOS window is not reinitialized. This utility is NOT for reverse engineering, but rather for debugging your own code. Start all your programs with an Int 3 instruction. When the Int 3 is executed, the utility traps it and gets control. When no debugging tool is active, the interrupts have no effect.

To just see  DDT in action and play with its commands, execute the batch file  DDT-Popup by clicking on the batch file, or enter the following command.
 

DDT-Popup      Invokes a demo of the utility (its easier to just click on it) This will cause  the debugger to become resident and then execute the hello program which contains an interrupt that will invoke the tool.  If you want to get fancy, build a shortcut to Popup on your desk top and it kicks off the modifiable batch file which can then invoke what you are debugging.

Alternately, in MsDOS under Windows, or standalone, just enter the following to the command prompts which accomplishes the same thing. .
 

DDT                   Invokes the utility
DDTHELLO     Executes a basic hello program containing an interrupt.
 
 
Window Commands:

There are six different windows available with the debugger. Each one is for a specific function. The window commands are each two characters long. The utility also shifts between window automatically based on different activities, as they occur.
 

AW                 Invokes the assemble/disassemble window
BW                 Sets the break/adstop display on.
CW                Returns the utility to the base command window
FW                Causes a function key display.
MW                 Is used for displaying storage and memory.
TW                 Causes an active trace window display.
Command Window:

The basic command window is broken down into zones. The upper left corner contains the segment registers and the auxiliary registers that pertain to each.

The registers in yellow may be modified by entering a command followed by a value. The green areas are the actual current values being used by the program undergoing debugging. Registers may be specified by either there 16 bit or 32 bit names.
 
 
 

Examples:

 
ESI=12345          Would cause the utility to alter the actual value of the register and the display would change as follows.
All variables entered are specified in hexadecimal and the leading character must be numeric.
 
  SI=C000           is invalid and will result in an error message.
SI=0C000         is the correct way to enter the value and would cause the following .

 
Additionally variables may be used in arithmetic expressions, using the four simple operators + - * / .

ESI=EDI+EAX+123    is perfectly valid

This structure is valid throughout the utility and almost all variables and commands function on either side of the equals sign.
 
 

Segment Registers :

Segment registers are peculiar in that their entry is treated as a 20 bit value. When in 8086 or real address mode, they must be specified with a trailing 0 to properly enter them.

 

DS=1230         The trailing zero is required to cause proper calculation.

  ESI=CS          Functions maintaining the 20 bit schema internally
  Valid keywords for specifying data displayed in this area are as follows:
 
 
 
 
 

General Registers :

 In the upper right corner of the command window are the general x8086 registers available for normal program usage.(consult Intel architecture for detailed discussion )

The following are all valid specifications.
 
 


 

Command Area:

The bottom area of the command window displays the interrupt status of the user program, the current instruction being executed and other useful; information

 Commands are entered in the white area and the standard cursor positioning keys are functional in the standard ways. The insert, backspace, delete and cursor positioning arrows are intuitive.

Commands entered remain in the area after the ENTER key is pressed, but only data entered ahead of the current cursor position is read and executed upon. There is no need to delete the rest of the data on a line following the cursor position as it will be ignored. (see valid commands)

The area depicted in pink containing 1C-0D will display the keyboard scan code and hexadecimal of the last keyboard character struck. (On the actual DDT screen it is in dark blue)
 
 

On the next line in green is the type of interrupt that occurred, causing the utility to take over and generate the display.
 
 
 

Assemble/Disassemble Window:

 
 
 

Examples A0=CS+100                 Set vector for display
A4=A0
Once a vector is set , the window displays instructions starting with that storage location, scrolling down until another set vector is encountered. All vectors set, become available for use as variables, the unset ones may be available too.

To clear a vector, simply enter it without an equal sign or equate to another null vector. .

Examples:
A4             Would clear A4 (and the colour would change)
A1=A4      Would clear A1 if A4 was un-initialized.
A0               Note *** the A0 clears all vectors from A0 to A9.
This clearing mechanism is used in a majority of displays.
 
 

Breakpoint Window:

The utility may be used set intercept breaks in the users programs in a number of ways. The user may code in his own permanent breakpoints by using an Int 3instruction. Whenever the program executes one of these, the utility is invoked and up pops the command window. It is a good idea to place anInt 3 at the beginning of each program one writes, as they have no effect when no debug tool is running.

 Additionally one may use the utility to place up to 9 breakpoints via

Examples: B0=$+7                 Set a breakpoint at current location +7
B3=B0                   Set a second break at the same address
These are one shot breakpoints. The utility places a hexadecimal CC in main storage and saves the byte located there. While they appear invisible in the Breakpoint and Assembly Windows, they are visible from the Memory Window.

Once a breakpoint is executed, the utility is given control and the breakpoint disappears. Note that multiple breaks at the same address will keep interrupting until all of them clear, before resuming execution.

The B0 to B9 vectors are used identically to the A0 to A9 vectors.

The utility allows full usage of the Intel Debug registers when running native MsDOS. These facilities may NOT be invoked when Windows/95 is running or in an MsDOS or V8086 window, as the operating system suppresses their use.

The Memory Window:

The memory window provides both a hexadecimal and ASCII display of main storage at the vectors set in a similar fashion to the A0 to A9 vectors.
 
 

Examples M0=DS+BX                 Set vector for display
M5=M0+50
Vectors may be cleared and set as described in the assembler window.

Note**When using offsets from an assembly listing, because of the way NASM uses the org on com files, one has to add 100h to any offset listed to find the variable in storage.
 

Trace Window:
 

The trace window and its facilities are not yet supported in this version of this utility.
 

Commands:
 

Keywords:
 
 

The utility allows the use of keywords in too many places to document. Most labels and identifiers can be used on either side of the equals sign. If in doubt, TRY IT. The module will let you know what works.

V1=CS/2 +M0+EAX+BH*2-1234 Might not be meaningful, but it is syntactically correct and functions !!!
 
 

$ character:

There is one reserved word that is not mentioned anywhere else. The $ is synonymous with entering CS+IP or CS+EIP. It is used as a short form in much the same was as the assemblers use it.
 

V1= $+20             might be handy in checking a jne $+20h instruction
 
 

Hints, Tips & Tricks:

Generally, one debugs a section of code, by setting a breakpoint and then stepping through the logic of that section, one instruction at a time using the ST command.

Clear debug registers with the D0 command before rebooting, or before exiting the program your interested it. Otherwise DDT will trap the operating system. The same applies to the breakpoint registers B0-B9.

To exit a program, set the instruction pointer to 0 and when the EX keyword is processed, the program will resume with the DOS return instruction contained in all program segment prefixes.

IP=0 and then an EX


The segment registers are a special case when tracing through POPs After a pop of a segment register, the utility is not invoked for one instruction and the trace will not bee seen. After a POP DS etc., put a NOP instruction when coding. While this will not be seen during tracing, everything else will.

Re-booting MsDOS from your ‘A’ drive and running standalone allows full debug register function. Alternately use the breakpoint functions B0-B9.

For information AEINC can be reached at

Aeinc@idirect.com
 
 

With our web site at

http://webhome.idirect.com/~aeinc