home *** CD-ROM | disk | FTP | other *** search
- INTRSPY & CMDSPY
- --------------------
-
-
- INTRSPY is a TSR that intercepts interrupts, and stores structures and
- register contents passed to and from these interrupts. It is accompanied by
- it's control program CMDSPY, which is transient, and acts as a compiler of
- scripts that specify the interrupts to intercept, the functions and
- subfunctions to monitor, and the structures to store.
-
-
- Usage of INTRSPY.EXE :
-
- INTRSPY [-rnnnn] [-innnn]
-
-
- where
- -rnnnn specifies the amount of memory INTRSPY is to allocate
- for result storage (default is 2k)
-
- -innnn specfies the amount of memory INTRSPY is to allocate
- for interrupt handler code. (default is 2k)
-
-
- example :
-
- INTRSPY -r24000
-
- runs INTRSPY with an allocation of 24000 bytes of results space,
- and the default 2k of interrupt handler code space.
-
-
-
- Usage of CMDSPY.EXE :
-
- CMDSPY [COMPILE [d:][path]inptfile[.ext] [param-1 [param-2 .. ]]]
- [REPORT [[d:][path]outpfile.ext]]
- [RESTART]
- [FLUSH]
- [STOP]
- [UNLOAD]
-
- where
- COMPILE compiles a script, and instructs INTRSPY to begin
- monitoring interrupts and storing results specified in the
- script, and
- inptfile.ext contains script source in the form defined in the
- next section. Any currently active script is stopped, and the
- results area is flushed.
- if the extension is omitted, .SCR is assumed.
-
- REPORT instructs INTRSPY to return the results accumulated so
- far. The file outpfile.ext, if specified, will contain the
- formatted output of the stored results of the current script
- since it was processed unless there has been a subsequent
- FLUSH.
-
- STOP instructs INTRSPY to stop monitoring interrupts, but to
- preserve the results area.
-
- RESTART instructs INTRSPY to restart, after a STOP command,
- monitoring interrupts on the basis of the currently compiled
- script.
-
- FLUSH instructs INTRSPY to clear down the results area, but
- leave the currently active script intact.
-
- UNLOAD instructs INTRSPY to unload itself from memory. Any
- active script is stopped.
-
-
-
- Script language
- ---------------
-
- The script language allows 8 main constructs. These are:
-
- INCLUDE, which includes another input file.
-
- STRUCTURE, which defines a data structure
-
- INTERCEPT, which specifies an interrupt, optional functions and
- optional subfunctions, together with the entry and exit processing to
- be done when that interrupt is triggered.
-
- RUN, which allows a DOS program to be exec'ed from within the script
-
- REPORT,
- FLUSH,
- STOP,
- RESTART, which work exactly like their command line counterparts.
-
-
- Syntax
- ------
-
- A script file is an ASCII file. All white space is ignored, except
- within literal strings used for results output. Thus indentation and
- splitting constructs across multiple lines may be used for
- readability. Line endings are only used to delimit comments, which are
- started with a semicolon anywhere on a line.
-
-
- INCLUDE Syntax
- --------------
-
-
- INCLUDE "[d:][path]inptfile[.ext] [param-1 [param-2 ....]]"
-
- includes the specified file, and substitutes param-1,
- param-2, etc., in the source in place of the strings %1,
- %2, etc., respectively, where found.
- If the extension is omitted, .SCR is assumed.
-
-
-
-
- STRUCTURE Syntax
- ----------------
-
- Let us define a field-definition as
-
- field-type [,field-disp-type [,field-dup]]
-
- where
-
- field-type can be BYTE, WORD or DWORD.
-
- field-disp-type can be HEX, BIN, DEC, PTR, DUMP, STRING, ASCII, ASCIIZ
- (DUMP is a combination of hex and ascii)
-
- field-dup is number of elements, if the field is an array, or
- length of field in, for example, a string. It may be a numeric
- literal or predefined constant. In the case of transient
- definitions (within OUTPUT or SAMELINE statements), field-dup
- may also refer to a register.
-
- Then STRUCTURE syntax looks like
-
- STRUCTURE struct-name FIELDS
- field-name1 (field-definition)
- [field-name2 (field-definition)]
- .
- .
- [field-nameN (field-definition)]
-
- struct-name must be a unique structure identifier.
-
- field-name must be unique within struct-name.
-
-
- INTERCEPT Syntax
- ----------------
-
- Let us define an output-element as
-
- REGS or
- register-name or
- flag-name or
- "string literal" or
- (seg:offs[offs]->struct.field->struct.field->struct) or
- (seg:offs[offs]->struct.field->struct.field->struct.field) or
- (seg:offs[offs]->struct.field->struct.field->field-definition) or
- built-in-constant
-
- where
-
- [offs] is an optional numeric literal,
- struct.field-> may appear up to 4 times, and struct and field must
- be predefined
- built-in-constant is one of the predefined constants defined in the
- Predefined Constants section below.
-
- Let us then define an output-clause as
-
- OUTPUT output-element [output-element [output-element .....]]]
- or
- SAMELINE output-element [output-element [output-element .....]]]
- or
- STREAM 8-bit-register
- DEBUG
-
- where
- OUTPUT starts a new line,
- SAMELINE attempts to append elements to an existing line,
- STREAM outputs bytes as otherwise unformatted characters
- DEBUG, if the intercept occurs during a RUN statement,
- enters the pop-up debugger (see The DEBUGGER below).
-
- Let us then define a test-clause as
-
- (something==something) or (something!=something)
- where something may be a sgereg, reg16, reg8,
- flag (oflag, cflag, iflag etc), or built-in-constant
-
- let us then define an if-clause as
-
- IF test-clause [AND test-clause [OR test-clause [ ..... ]]]
- [output-clauses]
-
-
- then INTERCEPT synatx looks like:
-
- INTERCEPT interrupt-number
- [output-clauses]
- [test-clauses]
- [FUNCTION fnctn-number [fnctn-number .....]
- [output-clauses]
- [test-clauses]
- [SUBFUNCTION sfnctn-number [sfnctn-number ..... ]
- [output-clauses]
- [test-clauses]
- [ON_ENTRY
- [output-clauses]
- [test-clauses]]
- [ON_EXIT
- [output-clauses]
- [test-clauses]]]
- [SUBFUNCTION sfnctn-number [sfnctn-number ..... ]
- .
- . ]
- [FUNCTION fnctn-number [fnctn-number ..... ]
- .
- .
- .
- . ]
-
-
-
- RUN syntax
- ----------
-
- RUN "[d:][path]program[.ext] [parm1 [parm2 ....]]"
- if the extension is omitted, first a .EXE then a .COM file
- is searched for, either in d:path if specified, or on the
- DOS search path if both drive and path are omitted.
-
-
-
-
- REPORT syntax
- -------------
-
- REPORT "[d:][path]outpfile.ext" or "" for STDOUT
-
-
-
- STOP syntax
- -----------
-
- STOP
- no parameters
-
-
- RESTART syntax
- --------------
-
- RESTART
- no parameters
-
-
- The DEBUGGER
- ------------
-
- The Monitor Debugger is a simple interactive debugger that allows
- access to some of CMDSPY's output capabilities from a command line.
-
- Current commands are:
-
- R - Displays the registers as they were when the caller
- generated the interrupt. It replicates the REGS
- output.
-
- D sreg:reg16[offs]->struct.field->struct.field->field-definition
- - Displays an area of memory. The argument to the
- command is an output-element, but without the
- parentheses.
-
- X - Exit the debugger.
-
- , - Recall previous commands for editing.
-
- The command line is fully editable using <BS>, , ,<CTRL>,
- <CTRL>, <DEL>, <ESC> (clears the command line), and is
- permanently in Insert mode.
-
-
-