Compaq BASIC for OpenVMS
Alpha and VAX
Systems
User Manual
Remarks
- Alpha BASIC does not support this qualifier.
- Using /DESIGN=PLACEHOLDERS on Alpha BASIC, causes an -E- level
error message.
- The Compaq Language-Sensitive Editor and Source Code Analyzer must
be installed on your system.
- If you specify the /ANALYSIS_DATA qualifier, the compiler includes
information about comments and placeholders in the analysis data file.
- /DESIGN=COMMENTS enables comment processing.
- /DESIGN=PLACEHOLDERS enables placeholder processing in place of
BASIC syntax.
- If you specify the /DESIGN qualifier but do not select an option,
the default is /DESIGN=(COMMENTS,PLACEHOLDERS); otherwise, the default
is /NODESIGN.
/[NO]DIAGNOSTICS [ = file specification
]
/NODIAGNOSTICS (default)
The /DIAGNOSTICS qualifier creates a diagnostics file containing
compiler messages and diagnostic information. The diagnostics file is
used by LSE to display diagnostic error messages and to position the
cursor on the line and column where a source error exists.
Remarks
- The Language-Sensitive Editor (LSE) must be installed.
- If you do not supply a file specification with the /DIAGNOSTICS
qualifier, the diagnostics file has the same name as its corresponding
source file and the file type .DIA. All other file specification
attributes depend on the placement of the qualifier in the command. See
the OpenVMS documentation set for more information.
- /NODIAGNOSTICS specifies that no diagnostics file is created.
/FLAG = (NODECLINING,NOBP2COMPATIBILITY,NOAXPCOMPATIBILITY)
(default)
The /FLAG qualifier lets you specify whether BASIC warns you about
declining features and compatibility with PDP--11 BASIC-Plus-2 and
Alpha BASIC.
Remarks
- /FLAG = (AXPCOMPATIBILITY) is not supported by Alpha BASIC. In
VAX BASIC, it issues a warning message about VAX BASIC features
not supported in Alpha BASIC.
- /FLAG = (BP2COMPATIBILITY) is not supported by Alpha BASIC. In
VAX BASIC, it causes the compiler to send a warning message about
declining features and incompatibility with PDP--11 BASIC-Plus-2.
- /NOFLAG causes the compiler to issue no warnings about declining
features and compatibility with PDP--11 BASIC--Plus--2.
- /FLAG = ALL is the same as /FLAG = (BP2COMPATIBILITY,DECLINING,
AXPCOMPATIBILITY).
- /FLAG = NONE is the same as /NOFLAG.
/INTEGER_SIZE = (LONG) (default)
The /INTEGER_SIZE qualifier lets you specify the default size for
integer data.
Remarks
- The default integer size (LONG) applies to all integer variables
whose data type is not explicitly declared. See the Compaq BASIC for OpenVMS Alpha and VAX Systems Reference Manual for
more information about integer data types.
- The QUAD option is not available in VAX BASIC.
/[NO]LINES
/LINES (VAX BASIC default)
/NOLINES (Alpha BASIC default)
The /LINES qualifier makes line number information available for the
ERL function and the BASIC error reporter. In VAX BASIC, the RESUME
statement with no target requires the /LINES qualifier, also.
Remarks
- In VAX BASIC, if your program contains a RESUME statement with
no target or a reference to the error-handling function ERL, the
compiler overrides NOLINES and signals "ERL overrides NOLINE"
or "RESUME overrides NOLINE." Note that the BASIC
error-reporting facility is separate from that of system traceback.
- /NOLINES causes line number information to be unavailable for the
ERL function, the RESUME statement with no target (VAX BASIC only),
and the BASIC error reporter. Specifying /NOLINES makes your
program run faster and reduces program size. However, specifying
/NOLINES causes the following restrictions to be in effect:
- You cannot use RESUME without a line number (VAX BASIC only).
- You cannot use the ERL function.
- No BASIC line number is given in run-time error messages.
/[NO]LISTING [ = file specification ]
/LISTING (default in batch mode)
/NOLISTING (default in interactive mode)
The /LISTING qualifier causes BASIC to produce a source listing file.
Remarks
- /LISTING = file specification produces a file with an
explicit file specification. Omitting the file specification
produces a listing file with the same name as its corresponding source
file and a file type of .LIS.
- All other file specification attributes depend on the placement of
the qualifier in the command. See the OpenVMS User's Manual for more
information.
- /LISTING only controls whether or not the compiler produces a
listing file and is the default in batch mode.
- /SHOW controls which parts of the listing are produced.
- /NOLISTING specifies that no source listing file be produced and is
the default at a terminal.
/[NO]MACHINE_CODE
/NOMACHINE_CODE (default)
The /MACHINE_CODE qualifier specifies that the listing file includes
the compiler-generated object code.
Remarks
- /MACHINE_CODE specifies that the compiler include a listing of the
compiler-generated object code in the listing file. In Alpha BASIC,
if the /LISTING qualifier is not specified as well, /MACHINE is ignored.
- /NOMACHINE_CODE specifies that the listing file not include
compiler-generated object code.
/[NO]OBJECT [ = file specification ]
/OBJECT (default)
The /OBJECT qualifier causes the compiler to produce an object module
and optionally specifies its file name. By default, the compiler
generates object files as follows:
- If you specify one source file, BASIC generates one object file.
- If you specify multiple source files separated by plus signs (+),
BASIC appends the files and generates one object file.
- If you specify multiple source files separated by commas (,), BASIC
compiles and generates a separate object file for each source file.
- You can use both plus signs and commas in the same command line to
produce different combinations of appended and separated object files.
Remarks
- /OBJECT = file specification produces an object file with
an explicit file specification. Omitting file specification
causes the compiler to produce an object file having the same name as
its corresponding source file and the file type .OBJ. All other file
specification attributes depend on the placement of the qualifier in
the command. See the OpenVMS User's Manual for more information.
- /NOOBJECT suppresses the creation of an object file. During the
early stages of program development, you might find it helpful to
suppress the production of object files until your source program
compiles without errors.
/[NO]OLD_VERSION[=CDD_ARRAYS]
/NOOLD_VERSION (default)
The /OLD_VERSION qualifier causes the compiler to change the lower
bound to zero and adjusts the upper bound of the array. For example,
Array 2:5 in CDD/Repository is translated by the compiler to
be an array with a lower bound of 0 and an upper bound of 3. The
compiler issues an informational message to confirm the array bounds.
The /NOOLD_VERSION qualifier causes the compiler to extract an array
from the CDD/Repository with the bounds as specified in the data
definition. For example, Array 2:5 in CDD/Repository is
translated by the compiler to be an array with a lower bound of 2 and
an upper bound of 5.
Remarks
- /OLD_VERSION[=CDD_ARRAYS] is provided for compatibility with
previous versions of BASIC.
- CDD/Repository assumes a default lower bound of 1, if none is
specified. Therefore, if no lower bound is specified, the compiler
translates the CDD/Repository array to have a lower bound of 1. For
example, Array 5 in CDD/Repository is translated by
BASIC to be an array with a lower bound of 1 and an upper bound
of 5.
/[NO]OPTIMIZE[=LEVEL=n]
/OPTIMIZE=LEVEL=4 (default)
The /OPTIMIZE qualifier causes the compiler to optimize the program to
generate more efficient code for optimum run-time performance.
Specifying /NOOPTIMIZE causes the compiler to perform minimal
optimizations.
The level options are available in Alpha BASIC only. The qualifier
has no options in VAX BASIC.
The following list describes the level options:
- 0 has the same effect as /NOOPTIMIZE. Most optimizations are turned
off.
- 1 has some optimizations (such as instruction scheduling).
- 2 adds more optimizations (such as loop unrolling and split
lifetime analysis) to those in level 1.
- 3 adds more optimizations.
- 4 is the default level. /OPTIMIZE=LEVEL=4 is equivalent to
/OPTIMIZE or not specifying the qualifier. Level 4 is the maximum
optimization level.
Remarks
- VAX BASIC does not support the [=LEVEL=n] option.
- Specify /NOOPTIMIZE if you specify /DEBUG when compiling a program.
/NOOPTIMIZE expedites and simplifies the debugging session by putting
the machine code in the same order as the lines in the source program.
Optimizations can cause unexpected and confusing behavior in a
debugging session.
- Specifying /OPTIMIZE, the default, usually makes programs run
faster. However, using /OPTIMIZE produces extra instructions to perform
the optimization, which might result in larger object modules and
longer compile times than the /NOOPTIMIZE qualifier.
- To speed compilations during program development, compile with
/NOOBJECT qualifier to check syntax, with /NOOPTIMIZE to check for
correct execution, and finally with /OPTIMIZE for the final check.
/REAL_SIZE = SINGLE (default)
The /REAL_SIZE qualifier specifies the default size for floating-point
data.
Remarks
- Alpha BASIC does not support HFLOAT. If HFLOAT is specified, the
program is compiled but causes an -E-level error message, and no .OBJ
file is produced.
- VAX BASIC does not support the IEEE floating-point types,
which are SFLOAT, TFLOAT, and XFLOAT. These Alpha BASIC types are
available for OpenVMS Alpha Version 7.1 or higher.
- The default floating-point size (SINGLE) applies to all
floating-point variables whose size is not explicitly declared.
See the Compaq BASIC for OpenVMS Alpha and VAX Systems Reference Manual for more information about floating-point data
types.
/[NO]ROUND_DECIMAL
/NOROUND_DECIMAL (default)
The /ROUND_DECIMAL qualifier causes the compiler to round packed
decimal numbers rather than truncate them.
The /NOROUND_DECIMAL qualifier causes the compiler to truncate packed
decimal numbers rather than round them.
The /ROUND_DECIMAL qualifier causes the INTEGER function to round
rather than truncate the decimal part.
/SCALE = n
/SCALE = 0 (default)
The /SCALE qualifier specifies a scale factor from zero to six,
inclusive. The scale factor affects only double-precision numbers. The
SCALE qualifier helps to control accumulated round-off errors by
multiplying floating-point values by 10 raised to the scale factor
before storing them in variables. It is ignored for all but
double-precision (DOUBLE) floating-point numbers.
Remarks
The /SCALE qualifier is provided for compatibility with existing
programs and with other implementations of BASIC. It is recommended
that you do not use this feature for new program development.
Accumulated round-off errors can be better controlled with packed
decimal numbers. See the Compaq BASIC for OpenVMS Alpha and VAX Systems Reference Manual for more information about
packed decimal numbers.
/[NO]SEPARATE_COMPILATION
/NOSEPARATE_COMPILATION (default)
The /SEPARATE_COMPILATION qualifier causes the compiler to place
individual compilation units in separate modules in the object file.
/NOSEPARATE_COMPILATION, the default, groups individual compilation
units in a source file as a single module in the object file.
When creating modules for use in an object library, consider using
/SEPARATE_COMPILATION to minimize the size of the routines included by
the linker as it creates the executable image. /SEPARATE_COMPILATION
also reduces the compiler virtual memory requirements when a source
contains several compilation units.
Remarks
- VAX BASIC does not support this qualifier.
- /SEPARATE_COMPILATION causes the Alpha BASIC compiler to place
each routine in a separate module within the output object, which is
consistent with VAX BASIC behavior.
- /NOSEPARATE_COMPILATION, in most cases, allows more interprocedural
optimizations.
/SHOW = (CDD_DEFINITIONS, ENVIRONMENT, INCLUDE, MAP, NOOVERRIDE)
(default)
The /SHOW qualifier determines which parts of the compilation listing
are created.
Remarks
- In Alpha BASIC, the size value for dynamically mapped arrays is
the size of the actual array. In VAX BASIC, the size value is the
size of the descriptors.
- /LISTING must be specified for /SHOW to be effective.
- CDD_DEFINITIONS controls whether the translation of a
CDD/Repository record is displayed in the listing.
- ENVIRONMENT lets you display all defaults that were in effect when
the program was compiled. This is the compilation listing equivalent of
the SHOW command in the environment.
- INCLUDE controls whether files accessed with the %INCLUDE
directive are displayed in the listing.
- MAP determines whether the listing contains an allocation map. The
allocation map lists all program variables, their size, and their data
type.
- OVERRIDE helps you debug code by disabling the effect of the
%NOLIST directive.
- /NOSHOW causes the compiler to display only the source listing.
- /SHOW = ALL is the same as /SHOW = (CDD_DEFINITIONS,
ENVIRONMENT, INCLUDE,MAP, OVERRIDE).
- /SHOW = NONE is the same as /NOSHOW.
/[NO]SYNCHRONOUS_EXCEPTIONS
/NOSYNCHRONOUS_EXCEPTIONS (default)
In Alpha BASIC, the default /NOSYNCHRONOUS_EXCEPTIONS qualifier
allows the compiler to reorder the execution of certain arithmetic
instructions to improve performance on the Alpha hardware. If a program
generates an arithmetic exception, such as an overflow or divide by
zero, certain statements surrounding the offending statement may or may
not be executed as a result of this reordering. Consider this example:
If the value of E is zero, the second statement will generate a divide
by zero error. As a result of instruction reordering, it is possible
that the assignment A = B will not take place. Further, it is possible
that the assignment G = F will take place even though the previous
statement generated an error.
The /SYNCHRONOUS_EXCEPTIONS qualifier disables reordering and produces
compatible behavior with VAX BASIC. Use this qualifier for programs
that rely on arithmetic exceptions to occur at precise times during
program execution.
The /SYNCHRONOUS_EXCEPTIONS qualifier impacts only arithmetic
exceptions and variable assignments in the immediate area of the
excepting statement.
Very few programs should require the /SYNCHRONOUS_EXCEPTIONS qualifier
to produce correct results.
Remarks
- VAX BASIC does not support this qualifier.
/[NO]SYNTAX_CHECK
/NOSYNTAX_CHECK (default)
The /SYNTAX qualifier causes the compiler to perform line-by-line
syntax checking. When syntax checking is enabled, BASIC checks the
syntax of every text line as you press Return.
Remarks
- Alpha BASIC does not support this qualifier.
- /NOSYNTAX_CHECK causes the compiler to suppress line-by-line syntax
checking. When syntax checking is disabled, the compiler does not
perform syntax checking until you COMPILE or RUN the program.
/TYPE_DEFAULT = REAL (default)
The /TYPE_DEFAULT qualifier lets you specify the default data type for
numeric variables.
Remarks
- EXPLICIT specifies that all program variables must be explicitly
declared in DECLARE, EXTERNAL, COMMON, MAP, or DIM statements.
- INTEGER, REAL, or DECIMAL specify that only variables and data
which are not explicitly declared default to integer, real, or packed
decimal.
- INTEGER_SIZE, REAL_SIZE, and DECIMAL_SIZE cause the compiler to
specify the actual size of variables and data.
/VARIANT = int-const
The /VARIANT qualifier lets you specify the value associated with the
lexical function %VARIANT. See Chapter 17 for more information about
VARIANT and the %VARIANT lexical function.
Remarks
- If /VARIANT is not specified, the default value is 0.
- If /VARIANT is specified without a value, the default is 1.
The /WARNINGS qualifier lets you specify whether BASIC displays
informational and warning messages.
Remarks
- Only the ALIGNMENT option is specific to Alpha BASIC. The other
options are supported by both Alpha BASIC and VAX BASIC.
- /WARNINGS=NOWARNINGS causes the compiler to display informational
messages but not warning messages.
- /WARNINGS=NOINFORMATIONALS causes the compiler to display warning
messages but not informational messages.
- /NOWARNINGS causes the compiler to suppress any informational or
warning messages.
- /WARNINGS=ALIGNMENT causes the Alpha BASIC compiler to flag all
occurrences of non-naturally aligned RECORD fields, variables within
COMMONs and MAPs, and RECORD arrays.
An aligned data item starts on
an address that is natural for that data type. Unaligned data accesses
on Alpha can significantly reduce performance. Table 3-1 lists the
natural boundaries for the supported data types.
/WARNINGS=NOALIGNMENT, the Alpha BASIC default, causes the
compiler not to issue any warning messages about unaligned data.
The Alpha BASIC compiler naturally aligns all local variables and
arrays, but it is the responsibility of the BASIC programmer to
naturally align COMMONs, MAPS, and RECORDs. The /WARNING=ALIGNMENT
qualifier flags all occurrences of non-naturally aligned items. This
helps the programmer identify and correct unaligned entities.
An
entity can be unaligned in the following ways:
- The entity does not start on a natural boundary for its data type.
There are several actions a programmer can take to resolve this:
- Rearrange the RECORD, MAP, or COMMON so that all entities start on
natural boundaries.
- Force proper alignment with fill items, as needed.
Note that the natural alignment for a RECORD is equal to the
largest alignment required by any of its fields. As an example, if a
RECORD has a byte, long, and double field, the alignment of the RECORD
would be quadword.
- For arrays of RECORDs and GROUPs, items can be unaligned if the
size of a RECORD or GROUP is not a multiple of the alignment
requirements of that RECORD or GROUP. For example, if a RECORD has a
natural alignment of quadword, the size of the RECORD must be a
multiple of eight. Otherwise, all array elements after the first might
start on an unaligned boundary. Avoid unaligned accesses by padding the
end of the RECORD with fill items.
- For VAX BASIC, /WARNINGS = ALL is the same as /WARNINGS =
(INFORMATIONAL, WARNINGS). For Alpha BASIC, /WARNINGS = ALL is the
same as /WARNINGS = (INFORMATIONAL, WARNINGS, ALIGNMENT).
- /WARNINGS = NONE is the same as /NOWARNINGS.
3.1.3 Declining Qualifiers and Their Recommended Replacements
The following qualifiers are declining features:
/BYTE
/DOUBLE
/GFLOAT
/HFLOAT
/LONG
/SINGLE
/TIE
/WORD
It is recommended that you replace them with newer qualifiers, as
follows:
Old Qualifier |
Recommended Replacement |
/BYTE
|
/INTEGER_SIZE=BYTE
|
/DOUBLE
|
/REAL_SIZE=DOUBLE
|
/GFLOAT
|
/REAL_SIZE=GFLOAT
|
/HFLOAT
|
/REAL_SIZE=HFLOAT
|
/LONG
|
/INTEGER_SIZE=LONG
|
/SINGLE
|
/REAL_SIZE=SINGLE
|
/WORD
|
/INTEGER_SIZE=WORD
|
See the description of the /[NO]FLAG=[NO]DECLINING qualifier in this
chapter. Also see the descriptions of the /INTEGER_SIZE and /REAL_SIZE
qualifiers in this chapter. The descriptions of the old qualifiers are
in the Compaq BASIC for OpenVMS Alpha and VAX Systems Reference Manual.