This is the common way to pass control between one control section and an entry point in the same load module. The external entry point must have been identified using an ENTRY instruction in the called control section if the entry point is not the same as the control section's CSECT name.
.
.
L 14,12(13) LOAD CALLER'S RETURN ADDRESS
L 15,NEXTADDR ENTRY NEXT
LM 0,12,20(13) RETURN CALLER's REGISTERS
BR 15 NEXT SAVE (14,12)
.
.
NEXTADDR DC V(NEXT)
.
.
USING *,12 Establish addressability
EARLY ST 1,PARMADDR Save parameter address
.
.
L 13,4(13) Reload address of old save area
L 0,20(13)
L 14,12(13) Load return address
L 15,NEXTADDR Load address of next entry point
LA 1,PARMLIST Load address of parameter list
OI PARMADDR,X'80' Turn on last parameter indicator
LM 2,12,28(13) Reload remaining registers
BR 15 Pass control
.
.
PARMLIST DS 0A
DCBADDRS DC A(INDCB)
DC A(OUTDCB)
PARMADDR DC A(0)
NEXTADDR DC V(NEXT)
The address of the list of parameters is loaded into register 1. These parameters include the addresses of two data control blocks (DCBs) and the original register 1 contents. The high-order bit in the last address parameter (PARMADDR) is set to 1 using an OR-immediate instruction. The contents of registers 2-12 are restored. (Since one of these registers was the base register, restoring the registers earlier would have made the parameter list unaddressable.) A branch register instruction using register 15 passes control to entry point NEXT.