address space, the ASN is translated by
using a set of tables whose origin is
contained in control register 14. A
two-level lookup is used. The ASN value
is partitioned into two indexes. The
first index selects an entry in the table designated by control register 14,
called the ASN first table, or AFT.
This entry designates another table,
called the ASN second table, or AST, an
entry of which is selected by the second
index. An entry in the second table
contains several parameters about the
new address space. The information in a
second-table entry includes: A validity indicator, generally
used to indicate whether the asso­
ciated address space is immediately
accessible. This is useful for
managing unassigned numbers and
swapped-out spaces. The origin and length of a table which provides control over whether
three of the DAS instructions are
authorized to use the new ASN.
This table is called the authority
table (AT). The authorization index (AX), or
level, of the new space. The orlgln and length of the
segment table to be used by DAT
when the new address space is
accessed. A control over whether a signal, in
the form of a space-switch-event
program interruption, is given for
two of the DAS instructions after a change to a new primary address
space is completed. The origin of a set of tables which
describe the entry points associ­
ated with a new prlmary space. These tables are used by the link­ age mechanism provided with DAS. A
two-level table structure is
provided. The first level is the linkage table (IT), whose entries
provide the origins of entry tables
(ET).
Changing the Secondary Address Space:
The SET SECONDARY ASN instruction causes
the secondary address space to be changed to the address space associated
with the ASN specified by the instruc­
tion. The ASN itself is placed in
control register 3 and is called the
secondary ASN, or SASN. The ASN is
translated to obtain the segment-table
designation for the space. This desig­
nation is placed in control register 7
as the secondary segment-table desig­
nation (SSTO). Instruction execution is
disallowed if the translation is not
authorized. The translation is author­
ized by a bit in the authority table at
an offset determined by the authori­
zation index in control register 4. The
instruction LOAD TERS also can
address space.
Moving Information
ADDRESS SPACE PARAME­
change the secondary
DAS provides three instructions for
moving information under the control of
two access keys. The instructions MOVE TO PRIMARY and MOVE TO SECONDARY permit the semiprivi­
leged program to move data from either
of the two current address spaces to the
other. These instructions are defined
such that a second access key can be
specified in addition to the PSW key.
The PSW key in these two instructions is
used as the access key for the storage
references to the primary address space.
Accesses to the secondary address space
are made by using a key specified in a
general register designated by the
instruction. Thus, the semiprivileged
program can use the instruction to move
data between a calling program area and
the semiprivileged-program area and to
specify the appropriate key to be used
in each area.
A third move instruction, MOVE WITH KEY, gives a semiprivileged program the capa­
bilityof moving information between a
caller-specified area and a
semiprivileged-program area in the same
address space. The instruction uses the
PSW key for the store accesses associ­
ated with the first operand and uses a
program-specified key for the fetch
accesses associated with the second
operand. Thus, a semiprivileged program
may set up the PSW key and specify the
source key so as to provide appropriate
authority checking on a caller-specified
address whether it be a source or a
target.
For all three move instructions, the
number of bytes to be moved is expressed
as a true length. A zero length is
allowed, with no movement performed. Up
to 256 bytes are moved each time one of
these instructions is executed, and a
condition code is set to indicate wheth­ er the number of bytes moved did or did
not exhaust the true length. These capabilities make the instructions suit­
able for use in a simple program to move
any number of bytes. This is partic­
ularly useful when the number of bytes
to be moved must be calculated by the
program.
Transferring Program Control
DAS permits programs operating at
different levels of authority to be Chapter 5. Program Execution 5-15
linked directly without the use of the SUPERVISOR CALL or MONITOR CALL instruc­
tion. The instructions PROGRAM CALL and PROGRAM TRANSFER provide a protected
mechanism for transferring control
between programs operating at different levels, or the same level, of control.
The PROGRAM CALL instruction specifies a 20-bit index, the PC number, which is
used to locate the information associ­
ated with the program to be called.
This information, called the entry
information, includes an authorization key mask, an entry key mask to be ORed into the PSW-key mask in control regis­
ter 3, the information to be loaded into
the problem-state and instruction­
address portions of the current PSW, and
a parameter which is made available to
the called program in general register
4. The entry information can also cause
an optional space-switching operation to
occur. The space-switching operation is
specified when a nonzero address-space
number (ASN) is provided as part of the
entry information. When space switching
occurs, the operation is called PROGRAM CALL with space switching (PC-ss). When
no space switching occurs, the operation
is called PROGRAM CALL to current prima­
ry (PC-cp).
The information associated with the
program to be called is obtained by
means of a two-level lookup: The first lookup consists in index­
ing into the linkage table to
obtain a linkage-table entry, which
contains an entry-table address. The second lookup consists in
indexing into the entry table to
obtain an entry-table entry, which
contains the entry information.
Since the information loaded into the
PSW and control registers is obtained
from tables set up by the control
program, system integrity is maintained
because the problem program cannot load
arbitrary values. The current values of
the PSW-key mask and the PASN are saved in general register 3. The problem­
state status and instruction address are
saved in general register 14.
A program can use PC-ss to call a
program in another address space. In
addition to isolating programs in
address spaces, this operation provides
for a change to a higher level of privi­
lege and authority. Thus, the called
program is entered with an authorization index that can permit access to address
spaces which are not authorized to the
caller, and with a different linkage
table. The called program can then
perform services for the calling program
by having easy access to these other
address spaces, without the requirement
that the calling program also have
access to these address spaces, and it
5-16 System/370 Principles of Operation may use program services which are not
available to the calling program. A
hierarchy of control can be established
and the integrity of the address spaces
maintained. PROGRAM TRANSFER may be used to restore
the information saved by PROGRAM CALL.
It ANDs information into the PSW-key
mask in control register 3 and loads the
problem-state status and instruction
address into the current PSW. However, PROGRAM TRANSFER cannot be used to
change from the problem to the supervi­
sor state. Like PROGRAM CALL, PROGRAM TRANSFER is described in terms of two
cases: PROGRAM TRANSFER with space
switching (PT-ss) and PROGRAM TRANSFER
to current primary (PT-cp). PT-ss occurs when the specified ASH is differ­
ent from the current PASN. PT-ss provides the return function to be
used by a program which has been called by means of PC-ss. The authorization
checking provided on PT-ss permits a table structure to be set up which
prohibits a program from increasing its
authority. PT-ss can also be used to
transfer control from one address space
to another of the same authority. PROGRAM CALL and PROGRAM TRANSFER are
valid only when the CPU is in the
primary-space mode. They cause a
special-operation exception to be recog­
nized when the CPU is in the secondary­
space mode or the real mode.
Handling Storage Keys and the PSW The handling of keys is facilitated by
instructions for changing and extracting
the PSW key in the problem state. A
semiprivileged instruction is provided
for obtaining the storage key associated
with a virtual-storage location.
INSERT PSW KEY, which is changed by DAS
to be semiprivileged, permits a semi­
privileged program to save the current
PSW key for later restoration.
INSERT VIRTUAL STORAGE KEY permits the
semiprivileged program to determine the
storage key associated with any partic­
ular virtual-storage location. It may
be used, for example, when one program,
with authority to more than one key,
calls another program and passes the
address of a location to be used as
either an input or output buffer. The
called program must determine the key
needed to access the buffer.
INSERT VIRTUAL STORAGE KEY is also
useful to the control program since the
instruction uses a virtual rather than a
real address. The sequence LOAD REAL
ADDRESS followed by INSERT STORAGE KEY or INSERT STORAGE KEY EXTENDED does not
Previous Page Next Page