Residency and addressing mode of programs

The control program ensures that each load module is loaded above or below 16 megabytes as appropriate and that it is invoked in the correct addressing mode (24-bit or 31-bit). The placement of the module above or below 16 megabytes depends on the residency mode (RMODE) that you define for the module. Whether a module executes in 24-bit or 31-bit addressing mode depends on the addressing mode (AMODE) that you define for the module.

The addressing modes have the following meanings:

z/OS MVS Programming: Assembler Services Guide provides detailed information concerning the AMODE and RMODE of modules of storage. z/OS MVS Programming: Extended Addressability Guide provides more information about how programs use the 64–bit address space.

You can define the residency mode and the addressing mode of a program in the source code. Table 1 shows an example of the definition of the AMODE and RMODE attributes in the source code. This example defines the addressing mode of the load module as 31 and the residence mode of the load module as 24. Therefore, the program will receive control in 31-bit addressing mode and will reside below 16 megabytes in 24-bit addressable storage.
Table 1. Assembler Definition of AMODE/RMODE
     
SAMPLE CSECT  
SAMPLE AMODE 31
SAMPLE RMODE 24

The assembler places the AMODE and RMODE in the output object module for use by the linkage editor. The linkage editor passes this information on to the control program through the directory entry for the partitioned data set that contains the load module. You can also specify the AMODE/RMODE attributes of a load module by using linkage editor control cards. See z/OS MVS Program Management: User's Guide and Reference and z/OS MVS Program Management: Advanced Facilities for information concerning these control cards.