Updated April 2010
xcall MIAMEX, MX_COMPIL, filename, switches {,defbuf, vcpattern, status}
MIAMEX function 15 is used to implement the A-Shell command programs COMPIL.LIT, OCMPIL.LIT, PRE.LIT and OPRE.LIT, by calling into the A-Shell BASIC compiler which is coded in C. See COMPIL.LIT in the A-Shell Command Reference for further information about the switches and variations of COMPIL.
filename (String) [in]
is the AMOS file specification or host pathname of the program to be compiled. The compiler itself will default the extension to BAS if necessary.
defbuf (String) [in]
contains one or more "define sym = value" statements (corresponding to /C:sym=value command line switches). Each statement must be terminated with chr(10). String values must be quoted. For example, the defbuf equivalent of the command line:
compil prog/x:2/c:MODE=1/c:PLATFORM$=Win
would be:
defbuf = "define MODE = 1" + chr(10) + "PLATFORM$ = ""Win"""+ chr(10)
vcpattern (String) [in]
contains the pattern specified in /VC:pattern
status (Num) [out]
returns 0 if the compile succeeds, else failure.
switches (Num) [in]
is a bitmap of switch values as listed below:
|
Value |
Corresponding COMPIL.LIT switch or variation |
|
&h0000001 |
/A (use 24-bit instead of 16-bit transfer addresses) |
|
&h0000002 |
/M (treat first instance of unmapped variable as an error) |
|
&h0000004 |
/O (omit line numbers from compiled program) |
|
&h0000008 |
Act as OCMPIL (instead of COMPIL) |
|
&h0000010 |
/S (silent output – omit ++include lines) |
|
&h0000020 |
/N (omit phase two compilation statistics) |
|
&h0000040 |
/X:1 (act as COMPLP – BASIC Plus mode) |
|
&h0000080 |
/D (limited d/BASIC support) |
|
&h0000100 |
/X:2 (A-Shell extensions) |
|
&h0000200 |
/V:1 (BASIC 1.4a compatibility) |
|
&h0000400 |
/T (Trace – output source while compiling) |
|
&h0000800 |
/I (assume old ISAM in ambiguous OPEN statements) |
|
&h0001000 |
/AV (handle >65K variable space) |
|
&h0002000 |
/B (output errors to prog.lst) |
|
&h0004000 |
/MX (like /M but complain for every occurrence of each unmapped variable |
|
&h0020000 |
/RC (RUN compatibility) |
|
&h0080000 |
/LF (generate lsx (list) file) |
|
&h0100000 |
/CI (case insensitive) |
|
&h0200000 |
/C:sym=value |
|
&h0400000 |
/IEEE |
|
&h0800000 |
/VC:pattern |
|
&h1000000 |
/LI |
History
|
2010 Mar, build 1177 |
Add status parameter. |