SYSSTATE — Identify system state
Description
- The addressing mode (AMODE) at the time the macro is issued
- The ASC mode of the program at the time the macro is issued
- The Architectural level in which the program will run at the time the macro is issued
- The earliest release level that the program will run on at the time the macro is issued
- Global character symbol &SYSAM64, to identify the AMODE
- Global character symbol &SYSASCE, to identify the ASC mode
- Global arithmetic symbol &SYSALVL, to identify the Architectural level
- Global character symbols &SYSOSREL and &SYSOSREL_NAME, to identify the release level
- In AMODE other than 64-bit
- In primary ASC mode
- In ESA/390 architectural level
- Prior to z/OS V1R6
- If you know that your program will run on or after a particular release of z/OS, use SYSSTATE with the OSREL parameter.
- If you know that your program will run on or after the release of z/OS that provided the SYSSTATE macro with which you are assembling, use SYSSTATE with OSREL=SYSSTATE.
- When using SYSSTATE with OSREL, use SYSSTATE ARCHLVL=OSREL, as that will set the ARCHLVL accordingly.
- Define the &SYSASCE global symbol within your macro.
- Issue SYSSTATE TEST, which sets &SYSASCE to the default if it has not yet been set.
- Define different logical paths within your macro to correspond to the ASC mode that is in effect based on the value of &SYSASCE.
A program need use SYSSTATE TEST only when it wants to query the value of one of the variables. When setting variables (i.e., not SYSSTATE TEST), you can specify one or more of the parameters available. The variables associated with not-specified variables remain unchanged.
Environment
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Problem state, and any PSW key. |
Dispatchable unit mode: | Task or SRB |
Cross memory mode: | Any PASN, any HASN, any SASN |
AMODE: | 24- or 31- or 64-bit |
ASC mode: | Primary or AR |
Interrupt status: | Enabled or disabled for I/O and external interrupts |
Locks: | The caller may hold locks, but is not required to hold any. |
Control parameters: | None. |
Programming requirements
None.
Restrictions
None.
Input register information
Before issuing the SYSSTATE macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
Output register information
- Register
- Contents
- 0-15
- Unchanged
- Register
- Contents
- 0-15
- Unchanged
Performance implications
None.
Syntax
The SYSSTATE macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␣ | One or more blanks must precede SYSSTATE. |
SYSSTATE | |
␣ | One or more blanks must follow SYSSTATE. |
TEST | |
ASCENV=P | Default: ASCENV=P |
ASCENV=AR | |
AMODE64=NO | Default: AMODE64=NO |
AMODE64=YES | |
ARCHLVL=0 | Default: ARCHLVL=0 |
ARCHLVL=1 | |
ARCHLVL=2 | |
ARCHLVL=3 | |
ARCHLVL=OSREL | |
OSREL=osrel | |
PUSH | |
POP | |
Parameters
The parameters are explained as follows:
- TEST
- TEST checks each one of the global symbols &SYSASCE, &SYSAM64,
and &SYSALVL, and does the following for each as required:
- Sets the global symbol to its default, if the global symbol does not contain a value indicating that it had been set by a prior SYSSTATE macro.
- Leaves the global symbol unchanged, if the global symbol does contain a value indicating that you issued a specific SYSSTATE during this assembly.
- ASCENV=P
- ASCENV=AR
- Indicates your program's ASC mode by setting the global symbol &SYSASCE.
- ASCENV=P indicates that the program is in primary mode.
- ASCENV=AR indicates that the program is in AR mode.
- AMODE64=NO
- AMODE64=YES
- Indicates whether your program is AMODE 64 at this point. It sets
the global symbol &SYSAM64.
- AMODE64=YES should be specified for any part of your program that runs in AMODE 64. Some macros process differently according to this specification. For example, macros such as ATTACHX, CALL, LINKX, LOAD, and XCTLX build prarmeter lists consisting of 8-byte entries when SYSSTATE AMODE64=YES.
- AMODE64=NO should be specified for programs, or parts of programs, that do not run in AMODE 64.
- ARCHLVL=0
- ARCHLVL=1
- ARCHLVL=2
- ARCHLVL=3
- ARCHLVL=OSREL
- Indicates the architectural level of the system for which the
subsequent section of your program is designed by setting the global
symbol &SYSALVL.
- 0
- Means that the architecture is ESA/390. When bit CVTOS390_R10 in byte CVTOSLV2 of the CVT data area is off, your program should not assume that ARCHLVL=1 or ARCHLVL=2 capabilities are available.
- 1
- Means that the architecture is ESA/390. When bit CVTOS390_R10 in byte CVTOSLV2 of the CVT data area is on, ARCHLVL=1 capabilities are available.
- 2
- Means that the architecture is z/Architecture. Macros that pay attention to ARCHLVL will avoid generating z/Architecture instructions when ARCHLVL < 2 is in effect. When byte FLCARCH in the PSA data area is not zero, ARCHLVL=1 and ARCHLVL=2 capabilities are available. If you set an ARCHLVL value less than the latest, your program can still run on more recent levels of the system, but it might not take advantage of all the new functions.
- 3
- Means that the architecture is the architecture level required by z/OS V2R1, which corresponds, roughly, to the IBM System z9 processor.
- OSREL
- Indicates to set the ARCHLVL according to the OSREL specification
using the following rules:
- When the OSREL release is at least z/OS V2R1, set &SYSALVL to 3.
- When the OSREL release is at least z/OS V1R6, set &SYSALVL to 2.
- Otherwise, set &SYSALVL to 1.
- Macros may expect that there is addressability to the literal area of your assembly language program at the point where the macro is invoked.
- You might still need to use the IEABRC or IEABRCX macro to have subsequent macros generate code that avoids the use of base-displacement branch instructions, since many macros are not sensitive to the value specified for SYSSTATE ARCHLVL. See z/OS MVS Programming: Assembler Services Reference IAR-XCT for details about the IEABRC and IEABRCX macros.
- OSREL=osrel
- Indicates the earliest operating system release that subsequent
macros may assume the code is running on by setting the global symbol &SYSOSREL
and &SYSOSREL_NAME. Specify osrel by specifying
the release name in the form ZOSVnRm, where n is
the version number and m is the release number.
For example, specify OSREL=ZOSV1R6 for z/OS V1R6.
For each new release, an analogous value will be added for osrel.
The system also provides global character macro variables for each
supported release which you can check within a macro. These macro
variables are of the form &SYSOSREL_ZOSVnRm.
You can also specify OSREL=SYSSTATE, which indicates that the OSREL is to match the release of z/OS that provided the SYSSTATE macro with which you are assembling.
- PUSH
- Saves current SYSSTATE global symbol settings. You can nest PUSH/POP to a depth of 255.
- POP
- Restore SYSSTATE global symbol settings to the previously saved levels. You can nest PUSH/POP to a depth of 255.
ABEND codes
None.
Return and reason codes
None.
Example 1
SAC 512
SYSSTATE ASCENV=AR
Example 2
L 15,X'10' Get CVT address
TM CVTOSLV3-CVT(15),CVTZOS_V1R6
JZ NOT_V1R6
SYSSTATE PUSH save SYSSTATE values
SYSSTATE OSREL=ZOSV1R6
LXRES ELXLIST=...
SYSSTATE POP restore SYSSTATE values
NOT_V1R6 DS 0H
Example 3
SAC 512
SYSSTATE PUSH
SYSSTATE ASCENV=AR
* code running in AR-mode
SYSSTATE POP
Example 4
MACRO
TESTMAC
GBLC &SYSOSREL
GBLC &SYSOSREL_ZOSV1R6
SYSSTATE TEST
AIF (&SYSOSREL GE &SYSOSREL_ZOSV1R6).GENV1R6
* produce code suitable for prior to z/OS v1 R6
AGO .MACEND
.GENV1R6 ANOP
* produce code suitable for z/OS v1 R6 or later
.MACEND ANOP
MEND