STXIT

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 90/60 series mainframe 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++ 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
* address protection violate (accessing memory not owned by the application)
* privilege violation (attempts to execute privileged instructions)
* divide check (division by zero)
* floating point check (floating point underflow or overflow)
* timer runout (where a timer set by the program has expired) this particular interrupt is not actually an error, it is how a program responds to a watchdog timer
* Interrupt resume, a function on the Univac 90/60 where an interactive user has issued a break to a program to go to command mode, and issued an INTR command to cause the program to resume at the INTR point. If the program has not specified an INTR resume address, the INTR command is rejected. This is similar to the REENTER command on the RT11 operating system on Digital computers.

The format of the Macro call was similar to the following (all parameters are optional except the R parameter, which is required)

"label" STXIT R,"error1","error2","error3",etc comment

Where
* "label" was the optional branch label used for the instruction
* STXIT is the name of the macro to the called
* R is used to indicate the class of STXIT call to be made (there were other formats created later)
* "error1" is the label of a routine used to handle error class 1 and
* "error2" is the label of a routine used to handle error class 2, etc.
* everything beginning one space after the last parameter was a comment about the macro call

The exact classes of which error is handled by which parameter cannot be given by this article because different versions of STXIT among different operating systems have used different parameter values.

The error routines are specified according to certain requirements, e.g. the first error routine might be used to handle program checks such as divide by zero, the second might be to handle interval timer runout, and another might be used to handle an indication from the operating system that the machine is being shut down and the program has to perform a checkpoint and terminate itself, or it will be terminated abruptly.

If a class of error 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 error causes that error to be handled by the operating system's "default" handler. For critical errors, the program crashes and is terminated; for non-critical errors the error is ignored.

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 STAE ("Set Task Abnormal Exit") macro. 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.


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”