AMODE and RMODE
Two attributes of a program: AMODE is which addresses it can use while running, and RMODE is where in storage it may be loaded.
Also written AMODE, RMODE, addressing mode, residency mode, AMODE 31, RMODE ANY
Every program on z/OS has two attributes set when it is compiled and link-edited. AMODE, the addressing mode, says how large an address the program uses while it runs: 24-bit, 31-bit or 64-bit. RMODE, the residency mode, says where in virtual storage the program may be loaded: below the 16 MB line, with RMODE 24, or anywhere, with RMODE ANY.
The values reflect the platform's history. Old programs used 24-bit addresses and had to live below the line. Most programs today are AMODE 31 and RMODE ANY, which lets them use storage up to the 2 GB bar and be loaded above the line, leaving the scarce space below it for things that really need it. Programs that use very large amounts of memory run in AMODE 64.
Problems come from mixing modes. A 31-bit program passing an address above the line to an old 24-bit program can cause that program to fail, often with an abend that is hard to explain.
The link-edit listing shows each program's AMODE and RMODE. When calls between old and new programs fail strangely, checking these two values is a good early step.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- Virtual storageThe memory each address space sees, which z/OS maps onto real memory and disk so that every program appears to have its own large space.
- Link-editCombining compiled object code with the other modules it needs into a single runnable program.
- Load moduleThe runnable form of a program, stored in a library, which JCL executes by name.
- CALLThe COBOL statement that runs another program and passes data to it, then continues when that program returns.
- z/ArchitectureThe design of the IBM Z processor, its instructions and how it handles memory, which traces back to the System/360 of 1964.