User`s guide

Recommended and Required Source Changes
3.3 Flow Control Mechanisms
Rout1: .CALL_ENTRY
.
.
X: .
.
.
RET
Rout2: .JSB_ENTRY INPUT=<R1,R2>, OUTPUT=<R4>, PRESERVE=<R3>
.
.
BRW X
.
.
RSB
To port such code to an OpenVMS Alpha or OpenVMS I64 system, break the
.CALL_ENTRY routine into two routines, as follows:
Rout1: .CALL_ENTRY
.
.
JSB X
RET
X: .JSB_ENTRY INPUT=<R1,R2>, OUTPUT=<R4>, PRESERVE=<R3>
.
.
RSB
Rout2: .JSB_ENTRY INPUT=<r1,r2>, OUTPUT=<R4>, PRESERVE=<R3>
.
.
JSB X
RET
.
.
RSB
3.3.3 Pushing a Return Address onto the Stack
The compiler detects any attempt to push an address onto the stack (for instance,
PUSHAB label) to cause a subsequent RSB to resume execution at that location
and flags this practice as an error. (On OpenVMS VAX systems, the next RSB
would return to the routine’s caller.)
Recommended Change
Remove the PUSH of the address, and add an explicit JSB to the target label
just before the current routine’s RSB. This will result in the same control flow.
Declare the target label as a .JSB_ENTRY point.
For example, the compiler would flag the following code as requiring a source
change.
Rout: .JSB_ENTRY
.
.
PUSHAB continue_label
.
.
RSB
By adding an explicit JSB instruction, you could change the code as follows. Note
that you would place the JSB just before the RSB. In the previous version of the
code, it is the RSB instruction that transfers control to continue_label, regardless
of where the PUSHAB occurs. The PUSHAB is removed in the new version.
Recommended and Required Source Changes 3–9