z/OS MVS Programming: Authorized Assembler Services Reference SET-WTO
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Telling the system about the execution environment

z/OS MVS Programming: Authorized Assembler Services Reference SET-WTO
SA23-1375-00

To generate code that is correct for the environment in which the program runs, some macros need to know one or more of the following characteristics about that environment:
  • 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 runs

For macros that are sensitive to their environment, use the SYSSTATE macro to define the environment. During the assembly stage, SYSSTATE sets one or more global symbols. Later, in your source code, the macro checks the global symbols and generates the correct code, which might mean avoiding using a z/Architecture® instruction or an access register. Table 1 lists MVS™ macros and identifies macros that need to know the environmental characteristics.

IBM® recommends you issue the SYSSTATE macro before you issue other macros. Once a program has issued SYSSTATE, there is no need to reissue it, unless the program switches from one AMODE to another or one ASC mode to another or has code paths that are isolated according to architecture level or operating system release. If you switch AMODE or ASC mode to a different architecture code path, issue SYSSTATE immediately after the switch to indicate the new state. In general, specify SYSSTATE ARCHLVL=1, and switch to SYSSTATE ARCHLVL=2 before issuing macros in sections of code that run in z/Architecture mode. If you do not issue the SYSSTATE macro, the system assumes the macro is issued:
  • In AMODE other than 64-bit
  • In primary ASC mode
  • In ESA/390 architectural level

The following table describes the relevant characteristics, the parameter on SYSSTATE, and the global symbol the macro checks.

Characteristic Parameter on SYSSTATE Global symbol
AMODE of 64-bit, or either 24-bit or 31-bit AMODE64=YES or NO &SYSAM64
Primary or AR ASC mode ASCENV=P or AR &SYSASCE
Architectural level of z/Architecture ARCHLVL=0, 1 or 2 &SYSALVL

You can issue the SYSSTATE macro with the TEST parameter in your own user-written macro to allow your macros to generate code appropriate for their execution environment.

Callable services do not check the global symbols described in this topic. To determine whether a callable service is sensitive to the AMODE, ASC mode, or the Architecture level, see the description of the individual callable service.

In early releases of MVS, the SPLEVEL macro performs a function similar to SYSSTATE. The SPLEVEL macro identifies the level of the operating system, so that you can tune a macro expansion based on that level. You can use this where macro expansions change incompatibly. Because SPLEVEL applies to levels that the system no longer supports, it is not described in this topic.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014