Using access registers

For storing data, MVS™ offers a program the use of a virtual storage area called a data space. Assembler instructions (such as Load, Store, Add, and Move Character) manipulate the data in a data space. When you use instructions to manipulate data in a data space, your program must use the set of general purpose registers (GPRs) plus another set of registers called access registers. This chapter describes how to use access registers to manipulate data in data spaces.

Through access registers, your program can use assembler instructions to perform basic data manipulation, such as:

To fully understand how to use the macros and instructions that control data spaces and access registers, you must first understand some concepts.

What is an access register (AR)? An AR is a hardware register that a program uses to identify an address space or a data space. Each processor has 16 ARs, numbered 0 through 15, and they are paired one-to-one with the 16 GPRs. When your program uses ARs, it must be in the address space control mode called access register (AR) mode.
ieaa6f04

ARs are used when fetching and storing data, but they are not used when doing branches.

What is address space control (ASC) mode? The ASC mode controls where the system looks for the data that the program is manipulating. Two ASC modes are available for your use: primary mode and access register (AR) mode.
How does your program switch ASC mode? Use the SAC instruction to change ASC modes:

What does an AR contain? An AR contains a token, an access list entry token (ALET). An ALET is an index to an entry on the access list. An access list is a table of entries, each one of which points to an address space, data space, or hiperspace to which a program has access.

Figure 1 shows an ALET in the AR and the access list entry that points to an address space or a data space. It also shows the address in the GPR that points to the data within the address/data space.
Figure 1. Using an ALET to Identify an Address Space or a Data Space
ieaa6f01

For programs in AR mode, when the GPR is used as a base register in an instruction, the corresponding AR must contain an ALET. Conversely, when the GPR is not used as a base register, the corresponding AR is ignored.

By placing an entry on an access list and obtaining an ALET for the entry, a program builds the connection between the program and an address space, data space, or hiperspace. The process of building this connection is called establishing addressability to an address space, data space, or hiperspace. To add the entry to the access list, your program uses the ALESERV macro, which is described in The ALESERV macro.

A program adds an entry to an access list so that it can:
For the rest of this information, assume that entries in access lists point to data spaces, not hiperspaces or address spaces.