HLASM - BASR = Branch And Save Register
The opcode of the BASR instruction is X'0D'.
- Branch to a subroutine in a different CSECT - provided that
it can be invoked in the same addressing mode as the caller. In this case
R14 and R15 are usually used for the return address and destination
- Branch to a subroutine in the same CSECT - provided that
it can be invoked in the same addressing mode as the caller,
which will normally be the case. It is not unusual to use other
(less volatile) registers than R14 and R15 in this case.
- Obtain addressability to the current routine.
- Register to receive the return address.
- Register holding the destination address.
- The processor places the address of the byte following the BASR
instruction (which is both the next sequential instruction address and
the expected return address) in the first register.
- It branches to the address specified in the second register.
- The condition code does not change.
- Only if the processor is in Amode 31, then the high-order bit
of the 32-bit return address will be set to 1.
- If the second argument is register 0, then no branch will be taken;
only the return information is placed in the first register.
- BAS branches to a routine that is directly
addressable in base-displacement form.
- BCR is the preferred return instruction.
- BASSM branches to another routine that may need
to be called in a different Amode.
- The BASR instruction was introduced with the 370/XA architecture.
- The PSW's Amode setting determines how many bits are used for the return
and destination addresses.
YREGS * Define register names
ENTRY BASR R15,R0 * Obtain routine address
USEBASE USING USEBASE,R15 * Make code addressable
LA R15,=V(SUBPROG) * Load address of subroutine
BASR R14,R15 * Call subprogram
To the Opcodes Overview.
To the English Homepage for Hlasm.com.
To the General Homepage for Bixoft and Hlasm.com.
This site is a member of WebRing.
You are invited to browse the
list of mainframe-loving sites.
Dinos are not dead. They are alive and well and living in data centers all
around you. They speak in tongues and work strange magics with computers.
Beware the dino! And just in case you're waiting for the final demise of
these dino's: remember that dinos ruled the world for 155-million years!
Dinos and other anachronisms
[ Join Now
| Ring Hub
Below you find the logo of our
and logos of the web-standards that this page adheres to.