Interactive Mode
To execute the MTB compiler from the READY prompt of the QMONITOR
program, type MTB. The following prompts are displayed:
Command File:
Source File:
If you press the Enter key without typing anything, the
program will exit back to the READY prompt of the QMONITOR
program.
Object File:
Listing File:
Options:
Above Correct?
Compiler options
The MTB compiler supports several optional parameters. These
control memory allocation, the listing device, and the type of
listing the compiler will produce. These options may be used in
interactive mode (see previous page), in an MTB command file list
command (see below for more information), or in the "#MTB"
compiler options file (see below for more information).
| Option
| Description
|
| B
| Byte-align COMMON
The MTB compiler's default method of aligning data
elements is based on word boundaries. This function is
normally transparent to the user and was included in the
original MTB compiler to speed up data retrieval and
storage. With today's hardware, word boundaries are no
longer a factor in operating speed. Because word
alignment could result in an additional byte being
allocated for each data element defined, we have added a
new option to the MTB compiler.
The "B" option causes the MTB compiler to "byte-align"
the COMMON data variables declared in your program. The
"B" option reduces memory requirements and also allows
you to intermix MTB and QICBASIC object programs
(QICBASIC programs use byte-aligned fields).
The default data alignment method for the compiler
remains "not byte-aligned." This option lets you
override the default.
Caution: Programs using COMMON data fields must all be
compiled with the same data alignment method (the default
or the "B" option); if not, your programs' COMMON data
will be garbled.
|
| E
| Errors only (default)
The "E" option causes the MTB compiler to produce an
errors-only listing when a program is compiled. The "E"
option is the default listing option.
|
| S
| Source listing
The "S" option causes the MTB compiler to produce a
source code listing when a program is compiled. If
compiler errors are present, they will be printed and
underlined with a rows of asterisks.
|
| X
| Write to Cross Reference File
This option causes cross reference information to be
written to data file on the same directory as the source
file. The cross-reference file is named "MXREFxxx", where
"xxx" is the user's partition number.
The compiler erases "MXREFxxx" and creates a new one each
time MTB is invoked by the user, but adds to it when
successive compilations are performed using a command
file. This permits the user to obtain a comprehensive
cross reference of all programs in a system, if desired.
The cross-reference file is a sequential file with 756-
byte records. Each record contains 27 entries of 28 bytes
each. The entry format is:
| Field |
Size |
Description |
| Symbol |
8 |
The symbol or statement label |
| String flag |
1 |
"$" if a string field, otherwise
blank. Note: This byte can duplicate
the "$" in the symbol field if the
symbol is less than 8 characters.
|
| Sort control |
1 |
0 for symbol definitions, 1 for references
The sort control field will force statement label
definitions to the top. This means that the first line
number will appear out of order if the statement label is
referenced in the program before it is defined.
|
| File name |
8 |
Name of source file or usefile |
| Line number |
7 |
Editor line number from source file |
| Type |
1 |
Type of statement or data value,using the following hex values:
F0 FORMAT statement
E0 Executable statement
All other variable types are bit-coded:
01 String
02 Variable, not constant
04 LOCAL
08 COMMON
0C Constant (can't be both local and $COM)
20 Array
|
| Precision |
1 |
Field precision. Ignore if non-numeric. |
| Length |
1 |
Field length. Ignore if statement
label, otherwise string length
(including length byte) or numeric
length.
|
|
Compiler options file (#MTB)
You can create a file called "#MTB" (any data file type) and put
in overriding options for the compiler. For example, if you want
to byte-align COMMON and get an errors-only listing for all of
your compilations, the first record in the "#MTB" file should
contain the letters "BE".
If you are using an MTB command file for your compilation, the
compiler recognizes and combines the options (E,S,O,B,A,X) from
your "#MTB" file with those specified in the list command (!L) of
your command file.
If you are using the interactive mode, the options contained in
"#MTB" will be displayed in the "Options" field.