Establishing the addressing mode of a program

Every program that executes in MVS™ is assigned two attributes: an addressing mode (AMODE), and a residency mode (RMODE). AMODE specifies the addressing mode in which your program is designed to receive control.

About this task

Generally, your program is designed to execute in that addressing mode, although you can switch modes in the program, and have different AMODE attributes for different entry points in a load module. The RMODE attribute indicates where in virtual storage your program can reside.

Table 1. Valid AMODE and RMODE specifications
Attribute Meaning
AMODE(24) Specifies 24-bit addressing mode.
AMODE(31) Specifies 31-bit addressing mode.
AMODE(ANY) Specifies 24-bit or 31-bit addressing mode.
AMODE(64) Specifies 64-bit addressing mode.
RMODE(24) The module must reside in virtual storage below 16 MB. You can specify RMODE(24) for 31-bit or 64-bit programs that have 24-bit dependencies.
RMODE(ANY) The module can reside in virtual storage below 16 MB, or above 16 MB but below 2 GB.
Note: C or C++ language programs must be link-edited with AMODE(31).

If you do not specify any AMODE or RMODE attributes for your program, MVS assigns the system defaults AMODE(24) and RMODE(24). To override these defaults, you can specify AMODE and RMODE in one or more of the following places. Assignments in this list overwrite assignments later in the list.

Procedure

  1. You can specify AMODE and RMODE on the link-edit MODE control statement:
    MODE AMODE(31),RMODE(ANY)
  2. You can specify AMODE and RMODE by using one of the following methods:
    • In the PARM string on the EXEC statement of the link-edit job step:
      //LKED EXEC PGM=IEWL,PARM='AMODE(31),RMODE(ANY),..'
    • On the LINK TSO command, which causes processing equivalent to that of the EXEC statement in the link-edit step.
  3. You can specify AMODE or RMODE statements in the source code of an assembler program. You can also set these modes in COBOL by using the compiler options. See the relevant application programming information for your COBOL compiler.


dfhp3c0072.html | Timestamp icon Last updated: Monday, 5 June 2017