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.
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.
The format of the Macro call depended upon the system it was used upon.
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. To establish a STXIT routine, you would code:
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).