Specifications

Saturn Options, Listings and Errors 9-9
Psy-Q Development System
XDEF, XREF and PUBLIC
Description If several sub-programs are being linked, use XDEF, XREF and PUBLIC to refer to
symbols in a sub-program which are defined in another sub-program.
Syntax XDEF symbol[,symbol]
XREF.size symbol[,symbol]
PUBLIC on
PUBLIC off
Remarks
In the sub-program where symbols are initially defined, the XDEF directive is
used to declare them as externals.
In the sub-program which refers the symbols, the XREF directive is used to
indicate that the symbols are in a another sub-program.
The Assembler does not completely evaluate an expression containing an
XREFed symbol; however, resolution will be effected by the linker.
The PUBLIC directive allows the programmer to declare a number of symbols as
externals. With a parameter of on, it tells the Assembler that all further symbols
should be automatically XDEFed, until a PUBLIC off is encountered.
Specifying a size of .w on the XREF directive indicates that the symbol can be
accessed using absolute word addressing.
Examples Sub-program A contains the following declarations :
xdef Scores,Scorers
...
The corresponding declarations in sub-program B are:
xdef PointsTable
xref Scores,Scorers
...
public on
Origin = MainChar
Force dh speed*origin
Rebound dh 45*angle
public off