Branch instruction

Any of the branching conventions shown in Table 1 can be used to request loading and branching to a segment. As a result, the requested segment and any segments in its path are loaded if they are not part of the path already in virtual storage. Control is then passed to the requested segment at the location specified by the address constant placed in general register 15.

Table 1. Branch sequences for overlay programs

Example

Name1

Operation

Operand2,3

1

L
BALR

R15,=V(name)
Rn,R15

2
 

 

 
 
 
ADCON

L
BALR
 
DC

R15,ADCON
Rn,R15
 
V(name)

3

L
BAL

R15,=V(name)
Rn,0(0,R15)4

4

L
BAL

R15,=V(name)
Rn,0(R15)5

56

L
BCR

R15,=V(name)
15,R15

66

L
BC

R15,=V(name)
15,0(0,R15)4

76

L
BC

R15,=V(name)
15,0(R15)5

Notes:
  1. When the name field is blank, specification of a name is optional.
  2. R15 must hold a 4-byte address constant that is the address of an entry name or a control section name in the requested segment. The address constant must be loaded into the standard entry point register, register 15.
  3. Rn is any other register and is used to hold the return address. This register is usually register 14.
  4. This can also be written so that the index register is loaded with the address constant; the other fields must be zero.
  5. In this format, the base register must be loaded with the address constant; the displacement must be zero.
  6. This example is an unconditional branch; other conditions are also allowed.

The address constant must be a 4-byte V-type address constant. The high-order byte is reserved for use by the control program and must not be altered during execution of the program. The BAS and BASR instructions cannot be used.

A branch between inclusive segments is always valid. A return can be made using the address stored in Rn. A branch between exclusive segments is valid if the conditions for a valid exclusive reference are met; a return can be made only by another exclusive reference.