STXIT

STXIT was an IBM System/360 series mainframe computer macro instruction under the DOS/VSE operating system, and was also available for the UNIVAC Series 90 mainframes running its TOS/DOS operating system and later on its VS/9 operating system.

Background

The macro was an abbreviation of the term "Set Exit," and was used by programs written in assembly language. It is used to create a recovery routine in the event of program errors, similar to signal handlers in C and Try/Finally blocks in C++, Java and other object oriented languages.

The STXIT macro would provide an error recovery address for several major types of errors and certain operator signals. The errors covered depended upon the operating system. In general, the errors which it provided recovery included

The timer interrupt STXIT provided a mechanism for sampling program execution and was used by various legacy performance analyzers. Essentially a PSW was gathered for each time interval and used for later analysis to determine hot spots.

The program check STXIT provided a mechanism for program animation via the deliberate introduction of invalid opcodes (on the fly) to locations in the target programs. Once the exit recovery was entered, the original opcode would be restored ready for later resumption and a new location set.

Macro Format

The format of the Macro call depended upon the system it was used upon.

IBM DOS/VSE

For DOS/VSE it was one of two forms, either the macro call to establish (create) a STXIT routine to handle the appropriate event, or a macro call to de-establish (no longer handle) the event.[1] To establish a STXIT routine, you would code:

[label] STXIT {AB|IT|PC|OC|TT}, RoutineAddress, SaveArea [,OPTION= {DUMP|NODUMP} ] comment

Where

When a STXIT routine completes, it returns to the point where it was invoked via the EXIT macro to return to the appropriate point where called, unless it is an AB routine, in which case it is not permitted to return and must issue a termination macro (EOJ, CANCEL, DETACH or DUMP).

To de-establish, or cancel a STXIT routine, you would code:

label STXIT {AB|IT|PC|OC|TT} comment

to cancel the routine for that event. Everything beginning one space after the parameter is a comment.

IBM z/VSE

For z/System VSE, all STXIT functions provided previously by IBM DOS/VSE are still supported. In addition, a new STXIT macro function 'Disabled Timer Appendage (DIE)' is available, but only for use in Supervisor Mode (Key 0, PSW privilege bit =1).[2] Format is:

label STXIT DIE,rtnaddr|(1)

Where DIE means the routine is to handle a "Disabled Interval timer Event", and rtnaddr is the address to handle the expiration of an interval timer when a Set TOD event is coded. The address may instead be specified as (1), meaning the address is stored in register 1. The routine is subject to strict restrictions including not changing any register contents or using most SVCs.

Univac VS/9

For Univac VS/9[3] it was

[label] STXIT R,[abend][,[progcheck][,[intr][,[setic][,[time][,[shutdown]]]] comment

Where

As the STXIT macro on VS/9 was parameter based, missing entries had to be entered with commas, e.g. if only the third item was being handled, the format would be

      STXIT R,,,RTN1

To remove one or more handlers, the STXIT macro is re-invoked with a blank entry for the handlers to be removed. Only one STXIT macro call can be in effect at any time.

If a class of event is not being handled, it is omitted, and there would be two (or more) commas in a row to indicate this. An unhandled class of event causes that error to be handled by the operating system's "default" handler. For events representing critical errors (abend and progcheck), the program is terminated with an EO79 error and the user has the option to request a PDUMP; for non-critical events the event is ignored.

Later developments

Later error recovery systems would provide for specifying errors explicitly as opposed to by the position of the parameter on the STXIT macro.

On IBM mainframes, newer operating systems such as OS/VS1 replaced the STXIT macro with the SPIE ("Set Program Interrupt Exit") and STAE ("Set Task Abnormal Exit") macroes. Univac's VS/9 continued to support STXIT but also added the CRTN ("Contingency Routine") macro to provide even more powerful error recovery, as well as recovery of some errors which STXIT did not capture. Originally, CRTN and STXIT could not be used together. Later releases of the operating system provided for both; if a CRTN and a STXIT macro were both used, the CRTN handled any events not covered by STXIT; if both were used to cover an event, the STXIT routine handled the event and the CRTN routine was not invoked.

References

  1. DOS/VSE Macro Reference, Doc. No. GC24-5140-0, International Business Machines Corporation, Endicott, New York, 1979.
  2. IBM z/VSE VSE Central Functions Supervisor Calls and Internal Macros, International Business Machines Corporation, White Plains, NY, 1985, 2007
  3. Univac VS/9 Programmer's Manual, Sperry Univac, Cinnaminson, NJ, 1974
This article is issued from Wikipedia - version of the 6/9/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.