MIAMEX 15: Call into BASIC compiler

Updated January 2014

xcall MIAMEX, MX_COMPIL, filename, switches {,defbuf, vcpattern, status}

MX_COMPIL 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 the documentation on COMPIL for more 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 &gt65K 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 

&h2000000

/P, preprocess for named parameter support

Hex-Decimal Values

 

History

2014 January, A-Shell 6.1.1371:  Add support for /P.

2010 March, A-Shell 5.1.1177:  Add status parameter.