Your exit routine must determine the type of interruption that
occurred before taking corrective action. Determining the type of
interruption depends on whether the exit is associated with an ESPIE or
a SPIE macro.
- For an ESPIE, your exit routine can check the two-byte interruption
code (the first byte is the exception extension code and the second
is the exception code) in the second halfword of the EPIEINT field
in the EPIE.
- For a SPIE, your exit routine can test bits 16 through 31 (the
first byte is the exception extension code and the second is the exception
code) of the old program status word (OPSW in ESA/390 mode)
in the PIE.
Note: For both ESPIE and SPIE – If you are using vector instructions
and an exception of 8, 12, 13, 14, or 15 occurs, your exit routine
can check the exception extension code (the first byte of the two-byte
interruption code in the EPIE or PIE) to determine whether the exception
was a vector or scalar type of exception.
For more information about the exception extension code, see IBM® System/370 Vector Operations.
Your exit routine can alter the contents of the registers when
control is returned to the interrupted program. The procedure for
altering the registers also depends on whether the exit is associated
with an ESPIE or a SPIE.
- For an ESPIE exit, the exit routine can alter the contents of general purpose
and access registers 0 through 15 in the save area in the EPIE.
- For a SPIE exit, the exit routine can alter general purpose registers
14 through 2 in the register save area in the PIE. To change registers
3 through 13, the exit routine must alter the contents of the registers
themselves.
The exit routine can also alter the last four bytes of
the OPSW in the PIE or EPIE. For an ESPIE, the exit routine alters
the condition code and program mask starting at the third byte in
the OPSW. By changing the OPSW, the routine can select any return
point in the interrupted program. In addition, for ESPIE exits, the
routine must set the AMODE bit of this four-byte address to indicate
the addressing mode of the interrupted program.
ESPIE exit routines can alter the ASC mode when control is returned
to the interrupted program if the EPIEVERS field in the EPIE contains
a value greater than zero. This value is set by the system. To alter
the ASC mode of the interrupted program, the exit must do the following:
- Set bit 17 of the EPIEPSW field in the EPIE. If this bit is 0
when control is returned to the interrupted program, the program receives
control in primary ASC mode. If this bit is 1 when control is returned
to the interrupted program, the program receives control in AR ASC
mode.
- Set the EPIERCTL bit in the EPIE to indicate that the ASC mode
for the interrupted program has been set by the exit routine.