Category : Assembly Language Source Code
Archive   : STEPDOS.ZIP
Filename : STEPDOS.DOC

 
Output of file : STEPDOS.DOC contained in archive : STEPDOS.ZIP

STEPDOS

by

Mike Parker

CIS 70270,161

11/07/87


============================================================
Program Description
============================================================

STEPDOS is a program written in assembly language that intercepts DOS
interrupt 21H then executes the target program specified on the command
line as a subprocess. Each time the target program does an 'INT 21H' call
STEPDOS takes over. A 'pop-up window' is displayed with the values of
all registers and a description of what the DOS call is about to do.


============================================================
Program Execution
============================================================

There is a program included in the STEPDOS.ARC file called DEMO.EXE
that will give a short demonstration of STEPDOS's capabilities.

DEMO.EXE does three functions.
1) Outputs a string using calls to DOS function code 02h (Display Character).
2) Checks keyboard input status.
3) Terminates itself.


For this demonstration first clear the screen by typing CLS .
Make sure DEMO.EXE is in your current directory and type:
STEPDOS DEMO


A window will pop up showing something like:

+-----------------------------------------------------------------------+
| AX BX CX DX DI SI BP SP DS ES SS CS IP FL |
| ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
| 02xx xxxx xxxx xx53 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| |
| |
| Output Character Hex 53 ASCII S |
| |
| Skip Current Function Return Code ESC - Non Stop |
+-----------------------------------------------------------------------+

The xxxx's under the register names above just mean that what you actually
see could be anything, only AH and DL are important right here.

Press any key except the 'S', the 'R' or 'ESCAPE' to execute the DOS function.

The character 'S' will be displayed at the current cursor position and the
STEPDOS window will come up again with:


+-----------------------------------------------------------------------+
| AX BX CX DX DI SI BP SP DS ES SS CS IP FL |
| ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
| 02xx xxxx xxxx xx54 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| |
| |
| Output Character Hex 54 ASCII T |
| |
| Skip Current Function Return Code ESC - Non Stop |
+-----------------------------------------------------------------------+

Press a key and the 'T' character will appear after the 'S'.
To keep you from having to press a key to display each character of a
potentially long text string use the 'Skip Current Function' option.
This tells STEPDOS to run nonstop as long as the current function (in this
case 02h) is being repeated by the target program.
When a function code other than 02h is executed, STEPDOS will resume display.

Now press 'S' to finish displaying the demo string. The following will appear:

+-----------------------------------------------------------------------+
| AX BX CX DX DI SI BP SP DS ES SS CS IP FL |
| ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
| 0Bxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| |
| |
| Check Standard Input Status |
| |
| Skip Current Function Return Code ESC - Non Stop |
+-----------------------------------------------------------------------+


To see how the 'Return Code' option works press the 'R' key and you
will see:

+-----------------------------------------------------------------------+
| AX BX CX DX DI SI BP SP DS ES SS CS IP FL |
| ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
| 0B00 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| |
| |
| Return Code = 0B00H Carry Flag = 0 Zero Flag = 1 |
| |
| Press Any Key To Continue |
+-----------------------------------------------------------------------+

This is the result immediately after the INT 21h code is executed.

Press any key to see:

+-----------------------------------------------------------------------+
| AX BX CX DX DI SI BP SP DS ES SS CS IP FL |
| ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
| 4C00 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| |
| |
| Terminate Process With Return Code 00H |
| |
| Skip Current Function Return Code ESC - Non Stop |
+-----------------------------------------------------------------------+

Press a key and STEPDOS will end, returning you to the DOS prompt.