Specifications
12-6 Programmer’s Guide Sega
Psy-Q Development System
XDEF, XREF and PUBLIC
Description If several sub-programs are being linked, to refer to symbols in a sub-program which
are defined in another sub-program, use XDEF, XREF and PUBLIC.
Syntax XDEF symbol[,symbol]
XREF 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.
• Specifying a size of .w on the XREF directive indicates that the symbol can be
accessed using absolute word addressing.
• 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.
Examples Sub-program A contains the following declarations :
xdef Scores,Scorers
xref.w PointsTable
...
The corresponding declarations in sub-program B are:
xdef PointsTable
xref Scores,Scorers
...
public on
Origin = MainChar
Force dc.w speed*origin
Rebound dc.w 45*angle
public off