Hardware manual

3.8. The Basic File System
A set of procedures for driving the disk hardware for Diablo Model 31 and 44 disk cartridges is included in
the operating system. These functions are documented in the "Disks" documentation, appended to this
manual.
3.9. Objects
It is often convenient to define an abstract object and its operations by a single entity in the Bcpl language.
As the largest entity Bcpl can deal with is a 16-bit number, we must use a pointer to a structure of some
kind that defines both the procedures and data associated with the object. Streams, Zones and Disks are
examples of such abstract objects. Such objects are typically defined by a structure such as:
structure ZN:
[
Allocate word //Op
Free word //Op
Base word //Val
Length word //Val
]
where the Op’s point to procedures and the Val’s are data for the structure. A typical call on one of the
abstract procedures is thus (zone>>ZN.Allocate)(zone, arg1, arg2, arg3). The virtue of such an
arrangement is that any structure that simulates the effects of the procedures can pose as a Zone.
In order to encourage the use of such objects, the operating system has very efficient implementations for
this calling mechanism:
Call0(s, a, b, ...) Does (s!0)(s, a, b, ...)
Call1(s, a, b, ...) Does (s!1)(s, a, b, ...)
Call2, Call3, ..., Call15 analogously.
Thus, the operating system defines Allocate=Call0, and Free=Call1, consistent with the Alloc package
described above. Note for assembly-language programmers: the CallX functions actually enter the proper
function at the
second instruction, having already executed a STA 3 1,2 to save the return address.
3.10. Miscellaneous
This section describes a collection of miscellaneous useful routines:
Wss(S, string) writes the string on stream S.
Ws(string) writes the string on the system display stream, dsp.
Wl(string) Ws(string), followed by a carriage return.
Wns(S, n, nc [0], r[-10]) writes a number n to stream S, converting using radix abs(r). At
least nc characters are delivered to the stream, using leading
spaces if necessary. The number is printed in signed notation if
r<0, in unsigned notation if r>0.
Wos(S, n) writes an unsigned octal representation of n on stream S.
Wo(n) writes an unsigned octal representation of n on the display
stream.
Alto Operating System May 5, 1980 13
For Xerox Internal Use Only -- December 15, 1980