MODE statement

The MODE statement specifies the addressing mode and the residence mode for all the entry points into the program module (the main entry point, its true aliases, and all the alternate entry points). The syntax of the MODE statement is:

MODE          modespec[,modespec]
modespec
One or both of the following:
  • The designation of an addressing mode for the output program object or load module by one of the following:
    • AMODE(24)
    • AMODE(31)
    • AMODE(64)
    • AMODE(ANY)
    • AMODE(MIN)
    Specifying AMODE(MIN) causes the most restrictive AMODE of all control sections within the program module to be assigned.

    See AMODE: Addressing mode option for more information about specifying AMODE.

  • The designation of residence mode for the output program object or load module by one of the following:
    • RMODE(24[,INITIAL|COMPAT])
    • RMODE(ANY|31[,INITIAL|COMPAT])
    • RMODE(MIN,[INITIAL|COMPAT])
    • RMODE(SPLIT)

    See RMODE: Residence mode option for more information about specifying RMODE.

Placement: The MODE control statement can be placed before, between, or after object modules or other control statements. It must precede the NAME statement for the module, if one is present.
Note:
  1. If more than one MODE control statement is encountered in the binding of a program object or load module, the last valid AMODE and RMODE specifications are used.
  2. The binder treats AMODE and RMODE values independently until they are required for output processing. At this time the combination of AMODE and RMODE values for each entry point are checked for conflict. See AMODE and RMODE combinations for information on AMODE and RMODE compatibility.
  3. The addressing mode assigned by the MODE control statement overrides the separate addressing modes found in the ESD data for the control sections within which the entry points are located. The addressing mode assigned by the MODE control statement overrides the addressing mode assigned by the AMODE parameter in the PARM field of the EXEC statement. A specified AMODE value applies to all entry points in the module, and is stored in all generated directory entries.
  4. The residence mode assigned by the MODE control statement overrides the residence mode accumulated from the input control sections and private code. The residence mode assigned by the MODE control statement also overrides the residence mode assigned by the RMODE parameter in the PARM field of the EXEC statement.

    A specified RMODE value applies to the entire module for load modules and single-segment program objects, unless the SCTR (scatter) option has been specified. For multiple-segment program objects, the specified RMODE value applies to all the segments containing initial load classes, unless the scope value is specified as COMPAT. With COMPAT, the specified RMODE value is applied only to the initial load segment containing the entry point(s); any other initial load segments retain the RMODE value as determined by the binder. See Residence mode for details. In all cases, the RMODE will be stored in all generated directory entries.