HLASM - BASSM = Branch And Save and Set Mode
The opcode of the BASSM instruction is X'0C'.
Usage
- Call a subroutine that might be in a different Amode.
- Obtain current address and Amode from the PSW.
Arguments
- Register to receive the return address and current amode.
- Register holding the destination address and desired amode.
Function
- 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:
- in Amode 24 the high-order bit of the 32-bit register is set to 0.
- in Amode 31 the high-order bit of the 32-bit register is set to 1.
- in Amode 64 the low-order bit of the 64-bit register is set to 1.
- 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:
- If the low-order bit of the register is 1,
then the processor switches to Amode 64.
- If the high-order bit of the register is 0 and the high-order bit of
the 32-bit register is 1, then the processor switches to Amode 31.
- If the high-order bit of the register is 0 and the high-order bit of
the 32-bit register is 0 as well, then the processor switches to
Amode 24.
- The condition code does not change.
Special Cases
- If the return address is in register 0, then the processor skips
the first operation.
- 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
- BSM is the preferred return instruction.
- BASR branches to a routine that is known to be
in the same Amode as the caller.
- SAM24 changes the Amode to 24 without
branching.
- SAM31 changes the Amode to 31 without
branching.
- SAM64 changes the Amode to 64 without
branching.
Hardware
- The BASSM instruction was introduced with the 370/XA architecture.
Remarks
- 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.
- The PSW's new Amode setting determines how many bits are used for the
destination address.
- 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.
|
|
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.