home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD2.mdf
/
tools
/
stepdos
/
stepdos.doc
< prev
next >
Wrap
Text File
|
1988-06-23
|
12KB
|
262 lines
-=: STEPDOS :=-
6/22/88
Version 3.0
(C) Copyright 1988 Mike Parker All Rights Reserved
============================================================
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.
STEPDOS detects whether a CGA or Monochrome adapter is active and will
determine which video page is currently active each time it puts up the
information window.
============================================================
Program Execution
============================================================
There is a program included in the ARC file for STEPDOS called TEST.COM
that will give a short demonstration of STEPDOS's capabilities.
TEST.COM does these functions.
1) Outputs a string using calls to DOS function code 02 (Display Character).
The string that is output is 'This is a test'.
2) Checks keyboard input status.
3) Does an OPEN of the "NUL" device using an FCB.
4) Terminates itself.
For this demonstration first clear the screen by typing CLS followed by
pressing the ENTER key.
Make sure TEST.COM is in your current directory and type:
STEPDOS TEST
followed by pressing the ENTER key.
A window will appear:
+------------------------- STEPDOS Version 3.0 -------------------------+
| |
| 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 Func Return Code ESC - Non Stop xxxx - Move Window |
| Display Memory FCB Display Watch Toggle |
+-----------------------------------------------------------------------+
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.
Move Window
===========
To move the window press any of the cursor positioning keys.
Executing DOS Call
==================
Press the ENTER or SPACE key to execute the call.
The character 'T' will be displayed at the current cursor position and the
STEPDOS window will come up again with:
+------------------------- STEPDOS Version 3.0 -------------------------+
| |
| AX BX CX DX DI SI BP SP DS ES SS CS IP FL |
| ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
| 02xx xxxx xxxx xx68 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| |
| Output Character Hex 68 ASCII h |
| |
| Skip Current Func Return Code ESC - Non Stop xxxx - Move Window |
| Display Memory FCB Display Watch Toggle |
+-----------------------------------------------------------------------+
Press the ENTER key and the 'h' character will appear after the 'T'.
Skip Current Func
=================
To keep you from having to press a key to display each character of a
potentially long text string use the 'Skip Current Func' 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 test string. The following will appear:
+------------------------- STEPDOS Version 3.0 -------------------------+
| |
| 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 Func Return Code ESC - Non Stop xxxx - Move Window |
| Display Memory FCB Display Watch Toggle |
+-----------------------------------------------------------------------+
Return Code
===========
To see how the 'Return Code' option works press the 'R' key and you
will see:
+------------------------- STEPDOS Version 3.0 -------------------------+
| |
| 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 |
| |
| Display Memory FCB Display ESC - Non Stop xxxx - Move Window |
| |
+-----------------------------------------------------------------------+
This is the result immediately after the INT 21h instruction is executed.
Press the ENTER key to see:
+------------------------- STEPDOS Version 3.0 -------------------------+
| |
| AX BX CX DX DI SI BP SP DS ES SS CS IP FL |
| ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- |
| 0Fxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| |
| Open File Using FCB at xxxx:xxxxH |
| |
| Skip Current Func Return Code ESC - Non Stop xxxx - Move Window |
| Display Memory FCB Display Watch Toggle |
+-----------------------------------------------------------------------+
FCB Display
===========
To see a formatted display of the File Control Block before the OPEN press
the 'F' key. The following window will appear:
+------------------------------+
| FCB Contents |
| |
| Extension Active = No |
| |
| Drive = Default |
| Filename = NUL |
| Extension = |
| Current Block # = 0000H |
| Record Size = 0000H |
| File Size = 00000000H |
| File Date = 00/00/80 |
| Driver Seg Addr = 0000H |
| Current Record # = 00H |
| Random Record # = 00000000H |
| |
| Press Any Key to Exit |
+------------------------------+
Press any key to remove the FCB window then press the 'R' key to execute
the OPEN and display the result.
After the OPEN is executed, the FCB can be viewed again and some of the
values will have been filled in. One "undocumented" field in the FCB is
the Driver Segment Address. After the OPEN this will contain the segment
address of the device driver for the NUL device.
Press the ENTER key to exit the result window and go to the 'Terminate
Process' function call.
Display Memory
==============
Press the 'D' key to display memory. Another window will pop up and you
will be prompted for a starting address. Enter the segment and address
separated by a colon (Seg:Addr) then press the ENTER key. Use the cursor
positioning keys to scroll around. Press ESCAPE to remove the memory
display window.
Watch Toggle
============
If you would like to monitor an area of memory each time an INT 21h is
executed press the 'W' key. Sixteen bytes starting at the last address
selected from the 'Display Memory' window will be displayed above the
register names.
+------------------------- STEPDOS Version 3.0 -------------------------+
| 0000:0000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |
| 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 Func Return Code ESC - Non Stop xxxx - Move Window |
| Display Memory FCB Display Watch Toggle |
+-----------------------------------------------------------------------+
Press the ENTER key and STEPDOS will end, returning you to the DOS prompt.
ESC Key
=======
Pressing the ESCAPE key when in the STEPDOS window causes your target
program to run full speed to completion without STEPDOS popping up
its window again.
============================================================
Program Changes
============================================================
1) Previous versions did not handle extended FCB properly.
2) Added 'Watch' of 16 bytes to main window.
3) Filled in 'undocumented functions' for DOS versions later than 3.00.
4) Made monochrome display more readable.
STEPDOS was written to help familiarize myself with the capabilities of all
of the DOS functions. I have used it to step through COMMAND.COM to see how
it works as well as some compilers, editors and assemblers. I have also
found it to be useful when you get one of those programs that says something
like 'File Not Found' the first time you run it but doesn't tell you what it
was looking for. You can run STEPDOS and it will tell you the filename that
the program wants.
If you find STEPDOS useful please send $10 (as well as any comments or
suggestions for improvement) to:
Mike Parker
2374 Meadowpark Court
Maryland Heights, MO 63043