User guide

34 CHAPTER 3. THE LIBRARY
Most implementations use pack 4 bytes into 32-bit words requiring B2Wsh=2, but on
64-bit imple me ntations, such as native code on the DEC Alpha or the 64-bit Cintcode
version of BCPL, its value is 3.
bootregs CIN:n, POS:y, NAT:n
This is the location in Cintcode memory used in Cintpos to hold Ci ntcode registers
during system startup.
bytesperword CIN:y, POS:y, NAT:y
Its value is 1<<B2Wsh being the number of bytes that can be packed into a BCPL
word. On 32-bit implementations it is 4, and on 64-bit versions it is 8.
bitsperbyte CIN:y, POS:y, NAT:y
This specifi es the number of bits per byte. On most systems bitsperbyte is 8.
bitsperword CIN:y, POS:y, NAT:y
It value is bitsperbyte*bytesperword being the number of bits per BCPL word.
It is usually 32, but can be 64.
CloseObj CIN:y, POS:y, NAT:y
This identifies the position of the close method in objects using BCPL’s version
of object oriented programming. Typical use is as follows:
CloseObj#(obj)
For more details, see mkobj described on page 55.
co
c, co fn, co list, co parent, co pptr, co size CIN:y, POS:y, NAT:y
These are the system fields as the base of coroutine stacks. If a coroutine is sus-
pended, its pptr field holds the stack frame pointer (P) at the time it became sus-
pended. The parent field points to the parent cor out i ne, if it has one, or is -1 for root
coroutines, and is ze r o otherwise. The list field holds the next coroutine in the list of
coroutines originating from global colist. The fn and size fields hold the coroutine’s
main function and stack size, and the c field i s a s y ste m work location. For more
information abou t coroutines, see createco described on page 47.
deadcode CIN:y, POS:y, NAT:n
To aid debugging, the entire Cintcode memory is initialised to deadcode. Typically
deadcode=#xDEADC0DE.
endstreamch CIN:y, POS:y, NAT:y
This is the val ue returned by rdch when reading from a stream that is exhausted.
Its value is normally -1.
entryword CIN:y, POS:y, NAT:n
To aid debugging, every functions entry point is mar ked by entryword. This is
normally followed by a function name compressed into a stri ng of 11 characters. If the