HLASM - BSM = Branch and Set Mode
The opcode of the BSM instruction is X'0B'.
Usage
- Return to a caller that might be in a differen Amode;
typically to return from a routine that was invoked by a
BASSM instruction.
- Obtain current Amode from the PSW.
- Insert current Amode from PSW into an address;
typically to modify the return address (usually in register 14)
in a glue module that enables programs in Amode 24 or Amode 31 to call
routines in a higher Amode.
Arguments
- Register to receive the current Amode.
- Register holding the destination address.
Function
- The processor inserts the current amode in the Amode receiver field:
- 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.
All other bits of the first argument remain unchanged.
- 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 Amode receiver field 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
- BASSM expects a return through the BSM
instruction.
Hardware
- The BSM instruction was introduced with the 370/XA architecture.
Remarks
- 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
...
BSM R0,R15 * Return to caller in correct Amode
YREGS * Define register names
...
L R15,=V'NEWRTN' * Point to new routine
BSM R14,R15 * Make rtn bypass us when returning
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.