z/OS MVS Programming: Extended Addressability Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example of using TESTART

z/OS MVS Programming: Extended Addressability Guide
SA23-1394-00

In the following example, the stacking PC routine validates the caller's ALET to reduce the probability of taking a program check referencing storage. Only ALETs of 0 or ALETs on the DU-AL are valid for a space-switch PC routine. Because the primary and secondary address spaces have changed at the space-switch, an ALET of 1 or an ALET on the PASN-AL are not valid.

The following code checks for ALETs of 0 and 1. It then changes the ALET of 0 to 1 to reflect the change in primary and secondary address space at the space switch.
         SLR    5,5    SELECT ESTA CODE FOR DESIRED INFORMATION
*                         0 - PKM / SASN / EAX / PASN
         ESTA   4,5    LOAD INFORMATION INTO GPRs 4 AND 5
*                         GPR5 NOW CONTAINS EAX AND PASN
         EREG   1,1    GET CALLER'S AR/GPR1 FROM LINKAGE STACK
         .
         TESTART ALET=(1),EAX=(5)
         .
* THESE ARE THE       rc=0 - ALET IS 0
* TESTART RETURN      rc=4 - ALET IS VALID DU-AL ALET
* CODES.  0 AND 4     rc=8 - ALET IS VALID PASN-AL ALET
* MEANS A GOOD        rc=12 - ALET IS 1
* ALET.               rc=16 - ALET IS NOT VALID
*                     rc=20 - UNEXPECTED ERROR
         .
         LA     0,4
         CR     15,0      If RC=4, VALID DU-AL ALET
         BE     ALETOK
         LTR    15,15     If RC=0, ALET IS 0 (PRIMARY)
         BNZ    BADALET   OTHERWISE, ALET IS NOT USEABLE.
         .
         LA     0,1       BECAUSE ALET IS 0, MUST CHANGE IT TO 1
         SAR    1,0       DUE TO THE SPACE-SWITCH
ALETOK   EQU    *
         MVC    PARM,8(1) COPY USER PARAMETERS INTO LOCAL STORAGE
BADALET  EQU    *
         .
         .
PARM     DS     CL8       COPY OF USER PARAMETERS
         .

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014