User guide

4.3. COMMANDS 107
causes a line to be output by the com pi l e r for each non local identifier occurring in t he
program. A typical such line is as follows:
all G:201 LG queens.b[9] all&~(ld|col|rd)
It shows that the variable all was dec l ar e d as global variable 201 and i t s was loaded
in the compilation of stateme nts on line 9 of the program queens.b and the contex t of
its use was: all&~(ld|col|rd). These lines can be filtered and sorted to form a cross
reference listing of a program. See, for instance, the file BCPL/cintcode/xrefdata
or Cintpos/cintpos/xrefdata. If both VER an d XREF are specified the xref data is
appended to the verification stream. This allows the xref data generated by several
separate compilati ons to be concatenated. The resulting file can be filtered and sorted
by the sortxref command. Typical usage is as follows:
delete -f rawxref
c compall "ver rawxref xref"
sort rawxref to xrefdata
delete rawxref
The GDEFS switch is a debugging ai d to output the global numbers of any global
function defined in the program. For example:
bcpl gdefs com/bench100.b to junk
generates the followi n g output:
BCPL (3 July 2007)
G 1 = start
G259 = trace
G260 = schedule
G261 = qpkt
G262 = wait
G263 = holdself
G264 = release
G270 = idlefn
G271 = workfn
G272 = handlerfn
G273 = devfn
Code size = 1436 bytes
The UTF8 and GB2312 options specify the default encoding for extended characters
in string and character constants. This default can be overridden in individual constants
using the *#u and *#g escape sequences, as described on page 16.
The SAVESIZE option allows the user to specify the number of words in the argument
stack used to hold function return information. The default value is three making room
for the old P pointer, the return address and the entry point of the current function.
When compiling into native code using the Sial mechanism, the save space size may
be different, since, for instance, some or all of this information may be stored in the
hardware (SP) stack.