SYSSTATE Macro - Identify System State

Use the SYSSTATE macro 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 ASC mode of the program at the time the macro is issued.
  • The addressing mode (AMODE) at the time the macro is issued.
For macros that are sensitive to their environment, SYSSTATE identifies the environment. During the assembly stage, SYSSTATE sets one or more of the following:
  • Global character symbol &SYSASCE, to identify the ASC mode.
  • Global character symbol &SYSAM64, to identify the AMODE.
Later, when the program is assembled, the macros check the global symbols and generate the code that is correct for the environment.
Issue SYSSTATE before you issue other macros. Once a program issues SYSSTATE, there is no need to reissue it unless the program switches from one ASC mode to another or one AMODE to another. If you switch AMODE or ASC mode, you should issue SYSSTATE immediately after the switch to indicate the new state. If you omit SYSSTATE, the following defaults are assumed:
  • Primary ASC mode
  • AMODE other than 64-bit

Format

Read syntax diagramSkip visual syntax diagramnameSYSSTATE ASCENV=P=AR=,1AMODE64=NOAMODE64=YES
Notes:
  • 1 If you specify both parameters, use a comma to separate them.
Read syntax diagramSkip visual syntax diagramnameSYSSTATE TEST

Requirements for the caller

AMODE:
24 or 31 or 64
RMODE:
24 or ANY
ASC Mode:
Primary or AR

Parameters

ASCENV=P | AR
Indicates your program 's ASC mode by setting the global symbol &SYSASCE.
  • ASCENV=P indicates that the program is in primary mode. This is the default.
  • ASCENV=AR indicates that the program is in AR mode.

Macros that support callers in both AR and primary mode are for example, DSPSERV and SDUMPX.

Issue the SYSSTATE ASCENV=AR macro at the time your program changes ASC mode to AR mode. If your program returns to primary mode, issue SYSSTATE ASCENV=P.
AMODE64=NO | YES
Indicates your programs AMODE by setting the global symbol &SYSAM64.
  • AMODE64=NO indicates that the program does not run in AMODE 64. This is the default.
  • AMODE64=YES should be specified for any part of your program that runs in AMODE 64. IARV64 is the only macro that tests &SYSAM64 and processes differently according to this specification.
TEST
Determines the current mode by checking the global symbols &SYSASCE and &SYSAM64 that were set by the most recent invocation of SYSSTATE.
  • If the global symbol does not contain a value, the global symbol is set to its default.
  • If the global symbol contains a value, the global symbol remains unchanged.
Depending on the setting of the global symbols, the caller of SYSSTATE TEST generates code and addresses that are correct for the environment in which the program runs.