User`s guide

Preparing to Port Macro-32 Code
1.7 Maintaining Common Sources
One is compiled with the VAX MACRO source code on an Itanium processor
If you choose to make code in a common source module conditional on architecture
type, include ARCH_DEFS.MAR on the command line in your assembly and
compilation and use .IF DF VAX or .IF DF ALPHA or .IF DF IA64.
A code pattern to avoid, and, in fact, to search for and change in already ported
code, is the use of the following:
.IF DF VAX
. . . ; VAX code
.IFF
. . . ; Alpha code
. . . ; will it work for IA64
.ENDC
or, worse:
.IF DF ALPHA
. . . ; Alpha code
.IFF
. . . ; VAX code, will likely fail for IA64
.ENDC
The best code would be:
.IF DF VAX
. . . ; VAX code
.IFF
.IF DF ALPHA
. . . ; Alpha code
.IFF
.IF DF IA64
. . . ; IA64 code
.IFF
.ERROR . . .
.ENDC
.ENDC
.ENDC
An ARCH_DEFS.MAR file is provided with OpenVMS Alpha and OpenVMS I64.
You need to create a corresponding file for OpenVMS VAX. The following is an
example of such a file:
; This is the VAX version of ARCH_DEFS.MAR, which contains
; architectural definitions for compiling sources for
; VAX systems.
;
VAX = 1
VAXPAGE = 1
ADDRESSBITS = 32
The Alpha version exists in SYS$LIBRARY and contains definitions for the
following symbols:
ALPHA—to indicate the source code is Alpha architecture-specific
BIGPAGE—to indicate the source code assumes variable memory page size
The I64 version exists in SYS$LIBRARY and contains a definition for the
following symbol:
IA64—to indicate the source code is Itanium architecture-specific
1–10 Preparing to Port Macro-32 Code