STXIT
   HOME

TheInfoList



OR:

STXIT is a
macro instruction In computer programming, a macro (short for "macro instruction"; ) is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion. The input and output ...
for the
DOS/360 Disk Operating System/360, also DOS/360, or simply DOS, is the discontinued first member of a sequence of operating systems for IBM System/360, System/370 and later mainframes. It was announced by IBM on the last day of 1964, and it was first de ...
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
for the
IBM System/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
series of
mainframe computer A mainframe computer, informally called a mainframe or big iron, is a computer used primarily by large organizations for critical applications like bulk data processing for tasks such as censuses, industry and consumer statistics, enterpris ...
s, and its successors on later mainframe series, and was also available for the
UNIVAC Series 90 The Univac 90/60 system front panel The Univac Series 90 is an obsolete family of mainframe class computer systems from UNIVAC first introduced in 1973. The low end family members included the 90/25, 90/30 and 90/40 that ran the OS/3 operating ...
mainframes running its TOS/DOS operating system and later on its
VS/9 VS/9 is a computer operating system for the UNIVAC Series 90 mainframes (90/60, 90/70, and 90/80), used during the late 1960s through 1980s. The 90/60 and 90/70 were repackaged Univac 9700 computers. After the RCA acquisition by Sperry, it ...
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 In signal processing, a signal is a function that conveys information about a phenomenon. Any quantity that can vary over space or time can be used as a signal to share messages between observers. The '' IEEE Transactions on Signal Processing' ...
handlers in C and Try/Finally blocks in C++,
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
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 In mathematics, division by zero is division where the divisor (denominator) is zero. Such a division can be formally expressed as \tfrac, where is the dividend (numerator). In ordinary arithmetic, the expression has no meaning, as there is ...
) * floating point check (floating point
underflow The term arithmetic underflow (also floating point underflow, or just underflow) is a condition in a computer program where the result of a calculation is a number of more precise absolute value than the computer can actually represent in memory o ...
or overflow) * timer runout (where a timer set by the program has expired) this particular
interrupt In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted ...
is not actually an error, it is how a program responds to a watchdog timer * Interrupt resume, a function on the
UNIVAC Series 90 The Univac 90/60 system front panel The Univac Series 90 is an obsolete family of mainframe class computer systems from UNIVAC first introduced in 1973. The low end family members included the 90/25, 90/30 and 90/40 that ran the OS/3 operating ...
where an
interactive Across the many fields concerned with interactivity, including information science, computer science, human-computer interaction, communication, and industrial design, there is little agreement over the meaning of the term "interactivity", but m ...
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
RT-11 RT-11 (Real-time 11) is a discontinued small, low-end, single-user real-time operating system for the full line of Digital Equipment Corporation PDP-11 16-bit computers. RT-11 was first implemented in 1970. It was widely used for real-time computin ...
operating system on Digital computers. 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 spot Hotspot, Hot Spot or Hot spot may refer to: Places * Hot Spot, Kentucky, a community in the United States Arts, entertainment, and media Fictional entities * Hot Spot (comics), a name for the DC Comics character Isaiah Crockett * Hot Spot (Tra ...
s. The program check STXIT provided a mechanism for
program animation Program animation or stepping refers to the debugging method of executing code one instruction or line at a time. The programmer may examine the state of the program, machine, and related data before and after execution of a particular line of co ...
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. To establish a STXIT routine, you would code: 'label''STXIT , ''RoutineAddress'', ''SaveArea'' OPTION= ''comment'' Where * ''label'' - the optional label for this statement. * First argument: One of , , , , or must be used. These indicated which event you were handling for that particular STXIT call. Except for the AB handler, a STXIT handler routine completed through use of the EXIT macro. To handle more than one event, multiple invocations of the macro must be used, each one specifying a single event. These codes indicate: ** - Abnormal task termination. A task is being terminated other than because of issuance of a CANCEL, DETACH, DUMP, or EOJ macro. The OPTION= parameter is only used with this type of routine. This determines whether a program dump is issued once the STXIT routine completes. If an abnormal task termination occurs without a STXIT routine to handle it, the program is terminated with an error. is also used if there is a Program Check event during any other STXIT routine. An routine cannot exit to return to the failing program, the routine must complete with a request to terminate the program via an EOJ, CANCEL, DETACH or DUMP macro. ** - Interval Timer. The program created an interval timer and the amount of time to measure has expired. An Interval Timer event is ignored if no STXIT routine exists to handle it. If additional Interval Timer events occur while an Interval Timer event is being serviced, they are delayed until the routine exits. Return from the routine is to the instruction that would have executed. ** - Program Check. The program has executed an illegal instruction, used data in an unallowed manner, or otherwise had a programming error. The STXIT routine can provide a clean recovery of the program in such cases. If a Program Check event occurs when no routine is provided, the program is terminated with an error. If a Program Check event occurs during a STXIT routine (other than AB), the AB routine is invoked. Return from the PC routine is to the next instruction after the failing one, unless the STXIT routine terminates the program. ** - Operator communication. The Operator has pressed the request key and issued a MSG command. This is ignored if no STXIT routine exists to handle it. Return from the routine is to the instruction that would have been executed. ** - Task timer runout. If a Task Timer is enabled through the SETT macro, this routine is used to handle them. If a task timer event occurs and no STXIT routine exists to handle it, the timer is ignored. If a subsequent task timer occurs while in a task timer handler routine, the event is ignored. Return from the routine is to the instruction that would have been executed. * ''RoutineAddress'' - the label of the routine to handle this event * ''SaveArea'' - a 72-byte area in which to save contents of the general registers, with standard savearea construct (the first two words are back and forward pointers, and the remaining words are used to save registers 14,15 and 0 through 12. Each STXIT routine must have its own save area, as it is possible for one STXIT routine to be interrupted by another, for example, the interval timer might fire while handling a task timer. The STXIT routines registers are saved automatically there when the routine is invoked, and are restored automatically when the EXIT macro is issued * Everything beginning one space after the last parameter is a comment. 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). 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''Univac VS/9 Programmer's Manual'', Sperry Univac, Cinnaminson, NJ, 1974 it was 'label''STXIT R, 'abend'', 'progcheck'', 'intr'', 'setic'', 'time'', 'shutdown'' 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) * ''abend'' is the label of an optional routine used to handle abnormal termination, which is any program termination other than the TERM, EXEC or EOJ macro. The program has 30 seconds of cpu time or 5 minutes of wall-clock time to recover and terminate itself or request execution of a new program, or the program is terminated automatically. Failure to have an abend routine causes the program to be terminated with an E079 error. The abend handler cannot return to the program, it must terminate with TERM or EOJ (or execute another program with EXEC) when it completes. The abend handler is also called if a progcheck occurs in the progcheck STXIT routine; a progcheck during an abend routine terminates the program immediately with an EO79 error, allowing the user to request a PDUMP if desired, unless a shutdown is in progress in which case the EO79 error is displayed, and the program is cancelled without allowing the user to request a PDUMP, and the user is automatically logged off. * ''progcheck'' is the label of an optional routine used to handle program checks, which are any errors in the program. If a progcheck routine is not present, the abend routine is invoked; if no abend routine exists either, the program is terminated with an EO79 error and the user has the option of requesting a PDUMP. Return is to the instruction after the failing one unless this routine specifies a new address. A progcheck occurring in any STXIT routine except progcheck and abend is passed here; a program check ''during'' the program check handler causes the abend routine to be invoked. A program check during the ABEND handler causes the program to terminate. * ''intr'' is the label of an optional routine used to handle the INTR command from the user's terminal after the user presses the break key on the keyboard. If no INTR routine exists, an INTR command by the user is rejected but the user may issue the R command to resume at the point of interrupt. Return is to the instruction being executed when the user issued a break unless this routine specifies a new address. * ''setic'' is the label of an optional routine used if the program issued the SETIC macro to create an Interrupt Condition timer. The IC timer is ignored if no handler routine exists for it. Return is to the instruction after the interrupt occurs unless this routine specifies a new address. * ''time'' is the label of an optional routine used if the user issued a TIME= parameter when executing the program to indicate it should break when the amount of CPU time has been consumed. When the routine finishes, the program will break, and the user can issue an INTR command to invoke the INTR routine, or issue the R command to resume the program when the time interrupted. If no time routine exists, the break occurs normally. * ''shutdown'' is the label of an optional routine used if the system console operator has requested to shut down timesharing. The program has a short period to allow itself to clean up any necessary features and quit. When the routine completes, the program is terminated and the user automatically logged off. If no shutdown routine exists, the program is cancelled without warning and the user automatically logged off. * everything beginning one space after the last parameter was a comment. 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. Univac's
VS/9 VS/9 is a computer operating system for the UNIVAC Series 90 mainframes (90/60, 90/70, and 90/80), used during the late 1960s through 1980s. The 90/60 and 90/70 were repackaged Univac 9700 computers. After the RCA acquisition by Sperry, it ...
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

IBM mainframe operating systems