HLASM - BASSM = Branch And Save and Set Mode

The opcode of the BASSM instruction is X'0C'.

Usage

  1. Call a subroutine that might be in a different Amode.
  2. Obtain current address and Amode from the PSW.

Arguments

  1. Register to receive the return address and current amode.
  2. Register holding the destination address and desired amode.

Function

  1. The processor places the address of the byte following the BASSM instruction (which is both the next sequential instruction address and the expected return address) in the first register. The current Amode is added as follows:
  2. The processor switches to the amode specified in the destination address register and subsequently branches to the address specified in that register. The new Amode is determined as follows:
  3. The condition code does not change.

Special Cases

  1. If the return address is in register 0, then the processor skips the first operation.
  2. If the Destination address is in register 0, then the processor will not change Amode, nor will it branch: it will continue with the next sequential instruction instead.

Related Instructions

  1. BSM is the preferred return instruction.
  2. BASR branches to a routine that is known to be in the same Amode as the caller.
  3. SAM24 changes the Amode to 24 without branching.
  4. SAM31 changes the Amode to 31 without branching.
  5. SAM64 changes the Amode to 64 without branching.

Hardware

  1. The BASSM instruction was introduced with the 370/XA architecture.

Remarks

  1. The PSW's old Amode setting determines how many bits are used for the return address. However, in Amode 24 a 31-bit return address is generated.
  2. The PSW's new Amode setting determines how many bits are used for the destination address.
  3. If the new Amode is 64, then the destination address is made even (all instructions have to be on even addresses) by replacing the low-order 1 by a 0 bit.

Examples

         YREGS                          * Define register names
         ...
         LOAD  EP=SUBRTN                * Returns dirty address in R0
         LR    R15,R0                   * Copy address + new Amode
         BASSM R14,R15                  * Call subroutine in correct Amode
         ...
         YREGS                          * Define register names
         ...
         BASSM R6,R0                    * Obtain address + current Amode
         ...

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.
Running Tyrannosaurus Rex 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 | Random | << Prev | Next >> ]
 

Below you find the logo of our sponsor and logos of the web-standards that this page adheres to.