User`s guide

Preparing to Port Macro-32 Code
1.5 Identifying Nonportable VAX MACRO Coding Practices
Temporarily removing the return address from the stack to allocate space on
the stack using mechanisms such as the following (see Section 3.3.4):
POPL R0 ; remove the return address
SUBL #structure_size,SP ; allocate stack space for caller
PUSHL R0 ; replace the return address
or
POPL R1 ; hold return address
PUSHL structure ; build structure for caller
;
; code continues
;
JMP (R1) ; return to caller
Pushing a label onto the stack, as in the following examples, often as
an attempt to construct a return address for an RSB instruction (see
Section 3.3.3):
MOVAL routine_label,-(SP)
RSB
or
PUSHAL routine_label
RSB
Modifying the frame pointer (FP) (see Section 3.1.1). VAX MACRO code
typically modifies the frame pointer for one of two reasons:
To manually assemble a call frame on the stack.
To use the frame pointer to reference local storage allocated in a .JSB_
ENTRY routine.
MOVL SP,FP
SUBL #data_area,SP
Constructing an REI target, as in the following examples (see Section 3.3.7):
MOVL #fake_psl,-(SP)
MOVAL target_label,-(SP) ; all three
REI
or
MOVPSL -(SP)
MOVAL target_label,-(SP) ; force AST delivery only
REI
or
MOVL #fake_psl,-(SP)
BSBW DOREI
;
; code continues
;
DOREI: REI
Branching to a destination that consists of a label plus an offset as in the
following example. The appearance of this practice in VAX MACRO code
might indicate a branch past some data in the code stream, such as the
register save mask at the top of a .CALL_ENTRY routine (see Section 3.2.1).
Alternatively, it might be a sign that the code is familiar with and dependent
upon the size of VAX instructions (see Section 3.2.3):
Preparing to Port Macro-32 Code 1–7