User`s guide
Preparing to Port Macro-32 Code
1.7 Maintaining Common Sources
1.7.1 Including Compiler Directive Definitions
A successful compilation does not preclude VAX MACRO code in a source file
from also processing successfully under the VAX MACRO assembler. If you
added any compiler directives to your code, they will be resolved by the library
SYS$LIBRARY:STARLET.MLB when the code is assembled. The assembler
automatically searches this library for any undefined macros. After finding these
definitions, the assembler will ignore occurrences of the compiler directives.
However, if you are using OpenVMS VAX Version 6.0 or earlier, you must
first extract the directive definitions from SYS$LIBRARY:STARLET.MLB
on OpenVMS Alpha or OpenVMS I64 and insert them into your
SYS$LIBRARY:STARLET.MLB on OpenVMS VAX. For example:
LIB/EXTRACT=.JSB_ENTRY/OUT=JSB_ENTRY.MAR SYS$LIBRARY:STARLET.MLB
.
.
.
LIB/INSERT SYS$LIBRARY:STARLET.MLB JSB_ENTRY.MAR
Note that many of the definitions of the compiler directives refer to other macros.
Make sure to extract not only the definitions of all the compiler directives
used in your code but also all the associated macros and insert them into
SYS$LIBRARY:STARLET.MLB on your OpenVMS VAX system.
1.7.2 Removing VAX Dependencies
If you must make changes to source files because they contain certain coding
practices that cannot be directly compiled into Alpha or Itanium code, you might
still be able to generate images for both OpenVMS VAX and OpenVMS Alpha
and/or OpenVMS I64 systems from common VAX MACRO sources.
Removing such VAX dependencies so that the same code can run on both
OpenVMS VAX and OpenVMS Alpha and/or OpenVMS I64 systems can yield
great benefits during the porting process. You can debug single modules or
groups of modules of the ported code by building and testing the modules in the
VAX environment or the Alpha environment, if the code has already been ported
to run there. This can greatly speed your debugging process.
In some cases, you must define and implement procedures for conditionalizing the
source files (as described in Section 1.7.3) or for providing separate sources for
OpenVMS VAX and OpenVMS Alpha and/or OpenVMS I64 systems.
If the code runs in an inner mode, it is unlikely that an effort to generate
OpenVMS VAX and OpenVMS Alpha and/or OpenVMS I64 images from
common VAX MACRO sources will be fully successful. Because inner-mode
code interoperates with the executive, it is vulnerable to the differences between
OpenVMS VAX and OpenVMS Alpha and/or OpenVMS I64 system interfaces and
executive data structures. However, user-mode code is generally immune from
architectural dependencies and can more easily serve as the basis for common
code.
1.7.3 Conditionalizing Architecture-Specific Code
Conditionalizing VAX MACRO code requires the use of the
SYS$LIBRARY:ARCH_DEFS.MAR file with architecture-specific symbols:
• One is assembled with the VAX MACRO source code on a VAX processor
• One is compiled with the VAX MACRO source code on an Alpha processor
Preparing to Port Macro-32 Code 1–9