User guide

68 CHAPTER 3. THE LIBRARY
str := sys(Sys
getprefix) CIN:y, POS:y, NAT:y
This returns a pointer to prefix st r i ng which is in space allocated when Ci ntsys aor
Cintpos was started.. See sys(Sys
setprefix,...) on page 73.
res := sys(Sys
getsysval, addr) CIN:y, POS:y, NAT:y
This function ret ur n the contents of the machine memory location whose address
is addr.
res := sys(Sys gettrval, count) CIN:y, POS:y, NAT:n
This returns a value from the l ow level trace buffer. See Sys
trpush for more
details.
res := sys(Sys
getvec, upb) CIN:y, POS:y, NAT:y
This allocates a vector whose lower bound is 0 and whose upper bound is upb. It
return zero if the request cannot be satisfied. A word is allocated just before the start
of the vector to hold its size, and several (typically 4 or 5) words are allocated just past
the end of the vector and filled with redundant data that is checked when the space is
returned to free store.
res := sys(Sys
globin, seg) CIN:y, POS:y, NAT:n
This initializes the global variables define in the loaded module pointed to by seg.
It returns zero is there is an error.
res := sys(Sys graphics,...) CIN:y, POS:y, NAT:y
This i s currently only useful on the Windows CE version of the BCPL Cintcode
system. It performs an operation on the graphics window. The graphics window is
a fixed size array of 8-bit pixels which can be written to and whose visibility can be
switched on and off.
res := sys(Sys
inc, addr, amount) CIN:y, POS:y, NAT:y
This function adds amount atomically to the specified memory location and returns
it new value.
res := sys(Sys interpret, regs) CIN:y, POS:y, NAT:n
This function enters the Cintcode interpreter rec ur s i vely with the Ci ntcode registers
set to values specified in the vector regs. On return the result is a return code indicating
why the interpreter r et ur ne d, and the elements of regs are set to hold the t he final state
of the Cintcode registers. These registers are described in the chapter on the design
of Cintcode starting on page 155 and the correspondence between the elements of reg s
and the Cintcode registers is given on page 72. The return codes are given on page 72.
res := sys(Sys intflag) CIN:y, POS:y, NAT:y
This returns TRUE if the user has pressed a particular combination of keys to in-
terrupt the program that is currently running. On many systems this mechanism not
implemented and so just return s FALSE.
res := sys(Sys
loadseg, name) CIN:y, POS:y, NAT:n
This attempts to load a Cintcode module from file name looking first in the current