You are on page 1of 3

AMODE & RMODE

sxdasgu

2010
Introduction

AMODE and RMODE are compiler options.

AMODE refers to the Addressing Mode i.e. and RMODE refers to the Residency
Mode.

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. Generally, your program is designed to execute in that mode,
although you can switch modes in the program, and have different AMODE
attributes for different entry points within a load module.

RMODE attribute indicates where in virtual storage your program can reside. Valid
AMODE and RMODE specifications are:

AMODE(24) Specifies 24-bit addressing mode.

AMODE(31) Specifies 31-bit addressing mode.

AMODE(ANY) Specifies either 24- or 31-bit addressing mode.

RMODE(24) Indicates that the module must reside in virtual storage below 16MB.
You can specify RMODE(24) for 31-bit programs that have 24-bit
dependencies.

RMODE(ANY) Indicates that the module can reside anywhere in virtual storage.

Significance of 16MB:
AMODE = 24 is nothing but 24 '1' in binary format. That is the maximum value
that can be stored in a 24-bit (3 byte) area.

With AMODE = 31, the maximum address value will be 2 GB (31 '1' in binary
format).

COBOL programs when compiled get translated into assembler first and then the
assembler program is compiled to generate the load. Assembler uses something
called registers to access memory locations. Each register is 4 bytes long (32-bits).
In AMODE=24, only the first 3 bytes of the register are used for addressing. In
AMODE=31, all 4 bytes except the leftmost is used for addressing.

The extreme left byte stores:


0 - 24 bit addressing
1 - 31 bit addressing
Now this is conventional 32-bit machines. In 64-bit machines, the size of the
register is 8 bytes. But so far, 64-bit OS still allows the programs to be loaded with
AMODE=31.

Combination of AMODE and RMODE is given in the following table:

AMODE RMODE Residence Addressing

24 24 Below 16MB 24-bit mode

31 24 Below 16MB 31-bit mode

ANY 24 Below 16MB 31-bit mode

31 ANY Above 16MB 31-bit mode

Source: http://publib.boulder.ibm.com/infocenter/cicsts/v3r1/index.jsp?
topic=/com.ibm.cics.ts31.doc/dfhp3/dfhp3om.htm

http://ibmmainframes.com/about10564.html

You might also like