% -*- Mode:TeX -*-
\chapter{Glossary}\label{gloss}

\def\loneskip{\smallskip}
\def\glitem#1{\hrule\smallskip\noindent{\tt#1}\quad}
\def\glalso#1{\par\noindent{\tt#1}\quad}
\def\gltail#1#2{\hfill{\tt#1}\quad{\tt#2}}
\def\see#1{\quad see {\tt#1}}

\newcommand{\glossarysize}{\footnotesize}
%\newenvironment{descr}{\begin{itemize}\item$\null$}{\end{itemize}}
%\newenvironment{descr}{\begin{itemize}\item$\null$\relax}{\end{itemize}}
\newenvironment{descr}{\begin{itemize}\item}{\end{itemize}}

The present glossary comprises two sections; the first deals with
\cam-specific words, while the second is devoted to general-purpose F83
words that have been included in the generic Forth system ({\tt F83.EXE})
upon which the \cam\ software is built.
The \cam\ section is fairly exhaustive: besides providing a handy
reference for the casual user, it lists all of the software primitives
that may be of interest to the sophisticated user.  On the other hand, the F83
section only lists words that are deemed notable for some reason. A
number of these words are original with the present implementation; a few F83
words have been renamed to avoid confusion with hexadecimal constants;\footnote
    {All single-digit hex numbers ({\tt 0} through {\tt F}) are defined
as constants; no two-digit hex numbers (i.e., {\tt 00} through {\tt FF}) are
used as names of words in the {\tt FORTH} vocabulary.}
    some entries are of a tutorial nature, as a complement to Chapter
\ref{tuto}; finally, some words are listed just to make you aware of the
useful functions they provide.

\medskip

Each entry of the glossary is headed by a Forth word---or
by several words that are
closely related in meaning.  The header entry contains several fields:
        \begin{itemize}
        \item The Forth word in question.  This may be followed by `{\tt
name}' or `{\tt filename}', denoting that, besides any arguments on the
stack, the word also expects a character string (usually the name of a
Forth word or of a file) to be read from the input stream.
        \item Stack comment, in parentheses (cf.\ Section
\ref{stack-comments}). No stack comment appears if the word does not expect or
leave anything on the stack. The dash in a stack comment is dropped if the word does not leave anything on the stack.
        \item The compiler which was responsible for creating the word.
        \item The source file where the word is defined.
        \end{itemize}
        For example, the following header
        \begin{verbatim}
    CENTERS  ( -- 2bits)         :     CAM-HOOD\end{verbatim}
        means that \id|CENTERS| takes no arguments from the stack;
returns a number (all arguments or results named in stack comments are
16-bit quantities unless otherwise specified) of which only the two
least significant bits are relevant (the others are all zeros); is
defined by the {\sc colon} compiler; and is loaded into the system from
the source file \id|CAM-HOOD.4TH|.  On the other hand, the header
        \begin{verbatim}
    INCLUDE  filename                :     CAM-BUF\end{verbatim}
        means that \id|INCLUDE| will look for a file name in the input stream
(in this case, the source-file text immediately following, since \id|INCLUDE| can be
used only in the interpretive mode), and will not affect the stack.

Among the abbreviations used within the stack comments, the most common
are \id|n|, for a generic number---often the number of a bit-plane;
\id|d|, for a {\sl double} number (two 16-bit values, with
the 16 most significant bits on top of the stack); \id|f|, for a logical flag (\id|TRUE|
or \id|FALSE|); \id|mask| for a bit mask; \id|len| for a length (e.g.,
number of bytes in a string); \id|str| for the address of a {\sl counted string} (the characters 
that make up the string are preceded by a {\sl count} byte); \id|addr|, for a 16-bit
address; \id|seg|, for an 8086 segment; \id|offs| for an offset.  A
mnemonic such as \id|row#| means ``row number'' (i.e., which row), while
\id|#rows| means ``number of rows'' (i.e., how many rows).

Note that `variable' generically refers to a quantity whose value may
change during the execution of a program.  We consistently use the
small-caps spelling when we mean a Forth {\sc variable} (i.e., a word that
returns the {\sl address} of its data cell, as explained in Section
\ref{constants}).

\medskip

Strictly speaking, \cam\ neighbor or pseudo-neighbor words such as
\id|NORTH| or \id|VERT| are compilation variables, and never know
anything about the data actually present on the \cam\ card (say, in the
bit-planes or in the address registers).  However, in describing their
function we use the convenient fiction that \id|NORTH|, for example,
``returns the value of the the north-neighbor bit in plane 0 or 2;''
what we mean is, of course, that ``the value returned by \id|NORTH| will
be used to compile a table entry which will be accessed during the
simulation just when the north-neighbor bit has that value'' (cf.\ Section
\ref{table-generation}).

Many pairs of neighbor words (such as \id|CENTER| and \id|CENTER'|, or
\id|HORZ| and \id|VERT|) are accompanied by a {\sl joint} version, which
is always a two-bit variable.  The least significant bit is the value of
the first element of the pair, the next bit that of the second element
(in arithmetic notation, ``the first bit plus twice the second'').
Thus, \idpad{\tt CENTERS}={\tt CENTER}+2\by{\tt CENTER'}\idpad, and
\idpad{\tt HV}= {\tt HORZ}+2\by{\tt VERT}\idpad.  Similar considerations
apply to the phase pseudo-neighbors (such as \id|PHASES|) and to the words
that control the phase pseudo-variables (such as \id|<PHASES>|), as explained
in Section \ref{phases}.

\medskip

Entries are in ASCII alphabetic order. Major neighborhood assignments
begin with \id|N/|, minor assignments with \id|&/|. Pseudo-variables
which are mapped into \cam\ shadow variables have the form \id|<...>|;
words such as \id|>PLN0| and \id|>BODY| are read ``to plane 0'' and ``to body.''
Variables used as flags end with a question mark. Routines whose actions
depend on such flags have names that start with a question mark.
Other conventions used in names either are generic Forth conventions
(see Appendix \ref{forth83}), or are explained along with the relevant words.

\newpage

\section{CAM words}\label{gloss cam}

%\redefine verbatim to use current size
\catcode`\@=11
\def\verbatim{\@verbatim \frenchspacing\@vobeyspaces \@xverbatim}
%vs. \def\verbatim{\@verbatim \frenchspacing\@vobeyspaces \@xverbatim}
\catcode`\@=12
\renewcommand{\labelitemi}{}
\renewcommand{\leftmargini}{\quad}

{\glossarysize

$\null$\medskip

%----------------
\glitem{\#CAMS}\verb|( -- n)|\gltail{:}{CAM-IO}
 \begin{descr}
Returns the number of \cam{}s that the software believes are installed.  This
number can be changed using the word {\tt CAMS}.
 \end{descr}

%----------------
\glitem{\#IDLES}\verb|( -- addr)|\gltail{VARIABLE}{CAM-STEP}
 \begin{descr}
This variable controls the rate at which steps occur when using the 
\cxp\ {\sl Run} command \keyS.  Speed is controlled by adjusting the number of
{\tt IDLE} (i.e., display-only) steps inserted between each active {\tt
STEP}.
 \end{descr}

%----------------
\glitem{\&/CENTERS}\gltail{:}{CAM-HOOD}
 \begin{descr} Minor neighborhood assignment for weak coupling between
\cama\ and \camb.  Makes the neighbors {\tt \&CENTER} and {\tt
\&CENTER'} available as part of the current neighborhood for either
\cama, \camb, or both (see {\tt CAM-A}).  The corresponding joint
version {\tt \&CENTERS} is of course also available.

{\sc note}: Two consecutive minor assignments should not be used
without an intervening major assignment.
 \end{descr}

%----------------
\glitem{\&/HV}\gltail{:}{CAM-HOOD}
 \begin{descr}
Minor neighborhood assignment. Makes {\tt \&HORZ}, {\tt \&VERT}, and {\tt
\&HV} available.  See also {\tt CAM-A} and {\tt \&/CENTERS}.
 \end{descr}

%----------------
\glitem{\&/PHASES}\gltail{:}{CAM-HOOD}
 \begin{descr}
Minor neighbor assignment. Makes {\tt \&PHASE}, {\tt \&PHASE'}, and {\tt
\&PHASES} available.  See also {\tt CAM-A}.
 \end{descr}

%----------------
\glitem{\&/USER}\gltail{:}{CAM-HOOD}
 \begin{descr} Minor neighborhood assignment.  Connects address lines 10
and 11 of the current \cam\ half to input pins UA10, UA11 (for \cama) or
UB10, UB11 (for \camb) of the user connector.  This is the default
after {\tt NEW-EXPERIMENT} and after each major neighborhood assignment, if no
explicit minor assignment is made.  Only {\tt CENTER}, {\tt CENTER'}, and
{\tt CENTERS} are always available.  See the description of {\tt ==} for
an example of how to give a name to a user neighbor for use in rules.
See also {\tt CAM-A}.		
 \end{descr}

%----------------
\glitem{\&CENTER}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{\&CENTER'}
\glalso{\&CENTERS}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD} 
 \begin{descr}
Neighbors made available by the minor neighborhood assignment {\tt \&/CENTERS}. 
The meaning of {\tt \&CENTER} is ``The center bit of the {\sl even}-numbered plane in the other
half of \cam.''  Thus, in a rule-component that is sent to \cama\ (see {\tt
>PLN0} and {\tt >PLN1}) it returns a bit from plane 2.

Similarly, {\tt \&CENTER'} refers to the {\sl odd}-numbered plane.
{\tt \&CENTERS} is the joint version of {\tt \&CENTER} and {\tt \&CENTER'}
 \end{descr}

%----------------
\glitem{\&HORZ}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{\&VERT}
\glalso{\&HV}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
 \begin{descr} Pseudo-neighbors made available by the minor neighborhood
assignment {\tt \&/HV}.  The word {\tt \&HORZ} returns the parity of the {\sl
horizontal} spatial position of the cell currently being updated,
relative to an origin set by {\tt <ORG-HV>}.

Similarly, {\tt \&VERT} returns the {\sl vertical} parity. 
{\tt \&HV} is the joint version of this pair.
 \end{descr}

%----------------
\glitem{\&PHASE}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{\&PHASE'}
\glalso{\&PHASES}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
 \begin{descr} Pseudo-neighbors made available by the minor neighborhood
assignment {\tt \&/PHASES}.  During a step, all cells see for {\tt
\&PHASE} the value that was assigned to the Forth word {\tt <\&PHASE>}
when the {\tt STEP} command was issued.

Similarly, {\tt \&PHASE'} gets its value from {\tt <\&PHASE'>}.
{\tt \&PHASES} is the joint version of this pair.
 \end{descr}

%----------------
\glitem{\&VERT}see {\tt \&HORZ}
\loneskip

%----------------
\glitem{*BEAM}\verb|( n)|\gltail{:}{CAM-HOOD}
 \begin{descr}
Toggle the visibility of beam $n$ (0, 1, 2, 3 = blue, green,
red, intensity).  See {\tt COLOR-MASK}.
 \end{descr}

%----------------
\glitem{+BEAM}\verb|( n)|\gltail{:}{CAM-HOOD}
 \begin{descr}
Make beam $n$ visible if it was temporarily turned off by {\tt
*BEAM} ( 0, 1, 2, 3 = blue, green, red, intensity); this cannot reverse
the effect of {\tt INVISIBLE}. See {\tt COLOR-MASK}.
 \end{descr}

%----------------
\glitem{-BUF>PDAT}\verb|( pl.mask src.seg offs r0 c0 #rows #byts row.incr)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Low-level primitive---alternative entry point to {\tt BUF>PDAT}.  This
routine sets the direction flag so that string moves from memory run
backwards.  Since bytes are always written to \cam\ forwards, this allows
strings of bytes to be reversed.  The offset given here should point to
the last byte of the buffer to be sent.  See also {\tt -PDAT>BUF}.
 \end{descr}

%----------------
\glitem{-PDAT>BUF}\verb|( pl.mask dest.seg offs r0 c0 #rows #byts row.incr)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Low-level primitive---alternative entry point to {\tt PDAT>BUF}.  Sets up
the \pc\ to perform string moves backwards.  Since \cam\ always reads the
data it sends forwards, this results in bytes being stored in reverse
order.  The offset should point to the last byte of the data buffer.  See
also {\tt -BUF>PDAT}.  (This routine is called by {\tt S/S-PL}).
 \end{descr}

%----------------
\glitem{-STEP\#}\gltail{:}{CAM-STEP}
 \begin{descr}
Negates the value of the doubleword variable {\tt STEP-NUMBER}; useful in conjunction
with reversible rules. More at {\tt STEP-NUMBER}.
 \end{descr}

%----------------
\glitem{/-PL}see {\tt NOT-PL}
\loneskip

%----------------
\glitem{2ARG}\verb|( -- d)|\gltail{:}{CAM-KEYS}
 \begin{descr}
Used within \cxp\ key definitions (see {\tt ALIAS}) to allow
parameters to be passed to Forth words attached to keys.  Works exactly
like {\tt ARG}, but returns a double number on the stack.
 \end{descr}

%----------------
\glitem{<\&PHASE>}\verb|( -- bit)|\gltail{=AAR}{CAM-HOOD}
\glalso{<\&PHASE'>}
\glalso{<\&PHASES>}\verb|( -- 2bits)|
 \begin{descr}
{\tt <\&PHASE>}, {\tt <\&PHASE'>}, and their joint version {\tt <\&PHASES>} are pseudo-variables
distinct from but similar in behavior to {\tt <PHASE>} and {\tt <PHASE'>}. Set using
{\tt IS} as in {\tt 1 IS <PHASES>}.
 \end{descr}

%----------------
\glitem{<ORG-H>}\verb|( -- bit)|\gltail{=AAR}{CAM-HOOD}
\glalso{<ORG-V>}
\glalso{<ORG-HV>}\verb|( -- 2bits)|
 \begin{descr} The pseudo-variable {\tt <ORG-H>} corresponds to the least
significant bit of the horizontal value of the space-grid origin.  A
\id|0| corresponds to an even position, a \id|1| to an odd one. 
The pseudo-neighbor word {\tt HORZ}, used during lookup table compilation,
refers to this pseudo-variable. Set using {\tt IS}.

        Similarly, {\tt <ORG-V>} corresponds to vertical origin.
{\tt <ORG-HV>} is the joint version of this pair, returning {\tt <ORG-H>}+2\by{\tt <ORG-V>}.
See {\tt HORZ} and {\tt \&HORZ}. Set using {\tt IS}, but see also {\tt EVEN-GRID} and {\tt ODD-GRID}.
 \end{descr}

%----------------
\glitem{<PHASE>}\verb|( -- bit)|\gltail{=AAR}{CAM-HOOD}
\glalso{<PHASE'>}
\glalso{<PHASES>}\verb|( -- 2bits)|
 \begin{descr}
The {\tt <PHASE>} pseudo-variable represents a phase bit present on the \cam\
card that can be controlled at will from the \pc.
The pseudo-neighbor word {\tt PHASE}, used during lookup table compilation,
refers to this pseudo-variable.

Similarly, {\tt <PHASE'>} represents another phase bit.
{\tt <PHASES>} is the joint version of {\tt <PHASE>} and {\tt <PHASE'>}.
See {\tt PHASE'}, {\tt <\&PHASE>}. Set using {\tt IS}.
 \end{descr}

%----------------
\glitem{<TAB-A>}\verb|( -- bit)|\gltail{=AAR}{CAM-HOOD}
\glalso{<TAB-B>}
\glalso{<TAB-AB>}\verb|( -- 2bits)|
 \begin{descr}
The pseudo-variable {\tt <TAB-A>} refers to a \cam\ bit
that controls whether the regular (\id|0|) or the auxiliary (\id|1|) tables of \cama\ are
in use (see {\tt >PLN0}, {\tt >AUX0}). For example, 
{\tt  0  IS  <TAB-A>}  sets \cama\ to use normal tables.

Similarly for {\tt <TAB-B>} and \camb.

{\tt <TAB-AB>} is the joint version of this pair.
A value of 0 means ``use the regular
tables for both \cama\ and \camb;'' a value of 3,``use the auxiliary
tables for both'' (bits 0 and 1 refer to \cama\ and \camb\ respectively). For example,
{\tt 1 IS <TAB-AB>} sets \cama\ to use the auxiliary tables and  \camb\ to use regular ones.

The words {\tt REG-TABS} and {\tt AUX-TABS} can also be used to set {\tt
TAB-AB} to 0 or 3, respectively.
 \end{descr}

%----------------
\glitem{=2ARG}\verb|( addr)|\gltail{:}{CAM-KEYS}
 \begin{descr}
Used for passing parameters to routines attached to control panel keys. 
Works like {\tt =ARG}, except that it stores a double number.
 \end{descr}

%----------------
\glitem{==}\verb|name  ( n)|\gltail{:}{CAM-HOOD}
 \begin{descr}
This word associates the given name to table address line $n$.
It can be used to name the ``unnamed'' neighbors
provided by {\tt N/USER}, {\tt \&/USER}, and {\tt N/MARG}.
 \smallskip
 \noindent Example: (in decimal)
        \begin{verbatim}
    NEW-EXPERIMENT CAM-A  N/MOORE  10 == RAND1  11 == RAND2\end{verbatim}
        would establish the Moore neighborhood on \cama, with two external
neighbors named {\tt RAND1} and {\tt RAND2} (perhaps coming from an
external random-number generator) attached to the UA10 and UA11 inputs of
the user connector.  Note that the default minor neighborhood {\tt
\&/USER} was automatically selected when a new major neighborhood was 
established.
 \end{descr}

%----------------
\glitem{=ARG}\verb|( addr)|\gltail{:}{CAM-KEYS}
 \begin{descr}
Used for passing parameters to routines attached to control panel keys. 
Works like {\tt ARG}, except that it expects an address on the stack, and
it takes any argument typed in and stores it as a 16-bit value in the
location specified by {\tt addr} (usually put on the stack by a {\sc variable}).  {\sl If no
argument was typed in, the value at {\tt addr} is unchanged!} This
is convenient to use with keys which have a default parameter: if no
argument is given, the last argument previously given remains in force.
 \end{descr}

%----------------
\glitem{>AUX0}\verb|( bit)|\gltail{>>}{CAM-HOOD}
\glalso{>AUX1}
\glalso{>AUX2}
\glalso{>AUX3}
\glalso{>AUXA}\verb|( 2bits)|\gltail{:}{CAM-HOOD}
\glalso{>AUXB}
 \begin{descr}
Column dispatcher for the auxiliary tables.  {\tt >AUX}$n$ works just like {\tt >PLN}$n$, but the result
for the neighborhood case being considered is sent to a table that will be
used to update plane $n$ only if {\tt <TAB-A>} is set appropriately.

{\tt >AUXA} is the joint version of {\tt >AUX0} and {\tt >AUX1} (and works like {\tt >PLNA});
{\tt >AUXB} that of {\tt >AUX2} and {\tt >AUX3}.
 \end{descr}

%----------------
\glitem{>BLUE}\verb|( bit)|\gltail{>>}{CAM-HOOD}
\glalso{>GREEN}
\glalso{>INTEN}
\glalso{>RED}
 \begin{descr}
Dispatchers for individual color-map columns. Low bit of value on the
stack indicates whether or not the named beam should be on or off for the
case under consideration.  See {\tt MAKE-CMAP} and {\tt
>IRGB}.
 \end{descr}

%----------------
\glitem{>GREEN >INTEN}\see{>BLUE}
\loneskip
%----------------
\glitem{>IRGB}\verb|( 4bits)|\gltail{:}{CAM-HOOD}
 \begin{descr}
Dispatcher for a whole color-map entry (see {\tt MAKE-CMAP}).  The four
lower bits of the value on the stack are used to determine the
color to be associated with a given cell-state (see the table in Section
\ref{color-map}).  See also {\tt IRGB}.
 \end{descr}

%----------------
\glitem{>PLN0}\verb|( bit)|\gltail{>>}{CAM-HOOD}
\glalso{>PLN1}
\glalso{>PLN2}
\glalso{>PLN3}
\glalso{>PLNA}\verb|( 2bits)|\gltail{:}{CAM-HOOD}
\glalso{>PLNB}
 \begin{descr}
Column dispatchers for the regular tables (see {\tt MAKE-TABLE}).  The low
bit of the argument to {\tt >PLN0} is used as the value to be
sent to plane 0 when the neighborhood configuration currently under
consideration is found.

Similarly for {\tt PLN1}, {\tt PLN2}, and {\tt PLN3}.  See also {\tt
PLN0}.

{\tt >PLNA} is the joint version of {\tt >PLN0} and {\tt >PLN1}.  Least significant bit of
argument is used for plane 0, the next for plane 1---the rest is ignored.
Similarly, {\tt >PLNB} is the joint version of {\tt >PLN2} and {\tt >PLN3}.
 \end{descr}

%----------------
\glitem{>RED}\see{>BLUE}.
\loneskip

%----------------
\glitem{?CAGE*PLNS}\gltail{:}{CAM-KEYS}
 \begin{descr}
If {\tt CFLAG} is set, exchange the contents of the cage buffer (see {\tt
CBUF-SEG} and {\tt CAGE-AREA}) with the active region of \cam's planes. 
Since most plane operations work on this active region, this causes
subsequent plane operations to act on the cage, with the area swapped into
the cage-buffer playing the role of the buffer.  Execute this a second
time to ``turn off'' the cage.

In performing the exchange of plane and buffer data, this routine uses
as an intermediate buffer the second half of the 8K temporary buffer at
{\tt TEMP-SEG}, whose contents is thus destroyed.
 \end{descr}

%----------------
\glitem{AAR}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Offset of \cam's ``auxiliary address'' register within each \cam's shadow
segment.  See {\tt <ORG-H>}, {\tt <PHASES>}, {\tt <\&PHASES>}, and {\tt
C!CAM}.
 \end{descr}

%----------------
\glitem{ALIAS name}\gltail{:}{CAM-KEYS}
 \begin{descr}
Used to attach a Forth routine to a key of the \cp.  User
routines are normally attached to {\tt Alt-} keys; all of the alphabetic {\tt Alt-} keys
plus \altfn1\ldots\altfn{10} are available for use by the user.  {\tt
ALIAS} attaches the named key to the most recently defined Forth word. For
example, 
        \begin{verbatim}
                         : Example
  ." This is an example" ;   ALIAS E\end{verbatim}
        would attach the Forth word ``{\tt Example}'' to the \alte\ key.
If this example were compiled, subsequently pressing \alte\ would cause
the letter {\tt E} to appear, then the word ``{\tt Example},'' and
finally the word would execute, producing its message ``{\tt This is an
example}.''

Note that you should use upper-case letter names, and upper-case {\tt F1}--{\tt F10}
for the key names following {\tt ALIAS}.  All user-defined keys automatically appear in the
{\tt ALTERNATE} menu of the \cp.

For those who are curious, {\tt ALIAS} is implemented by means of the
Forth {\tt VOCABULARY} mechanism. Each time {\tt ALIAS} is executed, it
puts an entry in the current alias vocabulary (see {\tt ALIASES} and {\tt
ORDER}).  When an {\tt Alt-} key is pressed, the key name is searched for
as a Forth word in this vocabulary, using {\tt FIND}; if found, it is
executed.  All the rest of the \cxp\ keys are attached in a
similar manner, using other {\tt ALIAS} vocabularies, such as {\tt
GENERAL}, {\tt PLANE-OPS}, etc.
 \end{descr}

%----------------
\glitem{ALIASES}\gltail{:}{CAM-KEYS}
 \begin{descr}
You probably don't want to use this word---it sets the aliases vocabulary
to be whatever is the context vocabulary when {\tt ALIASES} is executed. 
The \cam\ program puts key definitions into alias vocabularies: the
vocabulary that is used when the system is first booted is the {\tt
ALTERNATE} vocabulary.  All user definitions in this {\tt ALTERNATE}
vocabulary are invoked by {\tt Alt-} keys---all reserved for user
definitions.  If {\tt ALIASES} is used to change the aliases vocabulary,
system keys may become redefined and hence unavailable; and non-standard
keys will not all be automatically put into the {\tt ALTERNATE} submenu. 
See also {\tt ALIAS} and {\tt ORDER}.
 \end{descr}

%----------------
\glitem{ALPHA}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{ALPHA'}
\glalso{BETA}
\glalso{BETA'}
\glalso{ALPHAS}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
\glalso{BETAS}
 \begin{descr}
The four color-map inputs. {\tt ALPHA} usually returns the state of plane 0
and {\tt ALPHA'} that of plane 1---but see {\tt SHOW-FUNCTION}. Similarly, {\tt
BETA} and {\tt BETA'} refer to planes 2 and 3. Used in color-map generation (see {\tt MAKE-CMAP}).

{\tt ALPHAS} is the joint version of {\tt ALPHA} and {\tt ALPHA'}. Similarly for {\tt BETAS}.
 \end{descr}

%----------------
\glitem{ALTERNATE}\gltail{VOCABULARY}{CAM-KEYS}
 \begin{descr}
This is the {\tt VOCABULARY} in which user-defined {\tt Alt-} keys are
put.
 \end{descr}

%----------------
\glitem{AND>PL}\verb|( n)|\gltail{:}{CAM-BUF}
\glalso{OR>PL}
\glalso{XOR>PL}
\glalso{P*BUF}
\glalso{PL>PB}
\glalso{PB>PL}
\glalso{PLS>PBS}\verb|( --)|
\glalso{PBS>PLS}
 \begin{descr}
{\tt AND>PL} performs the logical {\sc and} function between plane $n$
and the corresponding plane buffer; the result is stored back in the plane. Similarly for {\tt OR>PL} and
{\tt XOR>PL}.

{\tt P*BUF} exchanges the plane with its buffer.

{\tt PL>PB} copies the plane to its buffer; vice versa for {\tt PB>PL}.
{\tt PLS>PBS} and {\tt PBS>PLS} (with no arguments on the stack) do the copying
for all four bit-planes.

See also {\tt PERMUTE} and {\tt AREA}

 \smallskip

All the above operations between planes and buffers affect only
the {\sl active} region of a plane and the associated buffer (see {\tt
NOT-PL}).
 \end{descr}

%----------------
\glitem{ANDS}\see{STORES}
\loneskip

%----------------
\glitem{AREA}\verb|( seg h w)|\gltail{:}{CAM-BUF}
 \begin{descr}
This word is used to set the values of the height and width of the active
region of the bit-planes, and to associate a buffer-segment with this
region.  Operations on planes, such as {\tt /-PL}, {\tt NOT-PL}, {\tt
RND>PL}, etc. (but not {\tt FILE>PL} and other disk I/O words) operate
only on the active region of the bit-planes.  Similarly, operations
between planes and buffers treat the planes as if they were only the size
of their active regions, and use a correspondingly small contiguous area
of buffers starting at the beginning of the given segment.

Two special cases which call {\tt AREA} are {\tt WHOLE-AREA} and {\tt
CAGE-AREA}.  The former sets the area to be the full screen, and the
associated buffer-segment to be the {\tt PBUF-SEG}---this is the default
situation which is generally in effect.  {\tt CAGE-AREA} uses the {\tt
CBUF-SEG} and height and width taken from variables {\tt C-HEIGHT} and
{\tt C-WIDTH}.  The active region's height, width, and associated segment
are available to any routine: they are supplied by {\sc constant}s {\tt R/8}, {\tt C/8} and
{\tt A-SEG}, which respectively return the height and width in units of
eight cell positions, and the associated segment.

As an example, if you wanted to define 4 extra plane buffers and copy the
planes to them, you could use (numbers are in hexadecimal)
        \begin{verbatim}
                                8000 SEGMENT EXTRA-BUFFERS
    EXTRA-BUFFERS 20 20 AREA
    PLS>PBS\end{verbatim}
        Note that the height and the width of the full screen (in units of eight-cell
positions) are both 20 (hex) (or 32 in decimal).  As a further example,
        \begin{verbatim}
    TEMP-SEG 4 6 AREA
    0 PL>PB   2 PL>PB\end{verbatim}
        would transfer data from a 32-high, 48-wide
area in the center of the screen to two areas of {\tt TEMP-SEG}.  The data
from plane 0 will go to offset 0, the data from plane 2 will go to offset
384 and following locations (4\by6\by8 bytes of buffer alloted per
plane).
 \end{descr}

%----------------
\glitem{ARG}\verb|( -- n)|\gltail{:}{CAM-KEYS}
 \begin{descr} Used within the definition of a \cxp\ key (see {\tt
ALIAS}) to take a numerical parameter from previous digit keystrokes.
If an argument was typed at the \cxp\ prompt immediately before
{\tt ARG} is executed, this argument is returned by {\tt ARG} as a 16-bit
value on the stack.  If there was no argument, a value of 0 is put on
the stack.  See also {\tt 2ARG}, {\tt ARG?}, {\tt =ARG}, and {\tt =2ARG}.
 \end{descr}

%----------------
\glitem{ARG?}\verb|( -- f)|\gltail{:}{CAM-KEYS}
 \begin{descr}
Can be used by routines which are attached to control-panel keys (see {\tt
ALIAS}).  It returns a logical flag to indicate whether an
argument was typed for this key (see {\tt ARG}).
 \end{descr}

%----------------
\glitem{AUX-TABS}\gltail{:}{CAM-HOOD}
 \begin{descr}
Used to select the auxiliary tables for both \cama\ and \camb.  This is
useful in a step-cycle---see also {\tt REG-TABS}, {\tt <TAB-A>},and
{\tt MAKE-CYCLE}.
 \end{descr}

%----------------
\glitem{AUX0}\verb|( -- bit)|\gltail{=NEW}{CAM-HOOD}
\glalso{AUX1}
\glalso{AUX2}
\glalso{AUX3}
\glalso{AUXA}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
\glalso{AUXB}
 \begin{descr} {\tt AUX0} is a table compilation variable; it returns
the value that will be sent to the {\tt AUX0} column of the current entry
in the lookup table.  Similarly for {\tt AUX1} etc.
  See {\tt >AUX0} and {\tt >PLN0}.

{\tt AUXA} is the joint version of {\tt AUX0} and {\tt AUX11} (={\tt AUX0}+2\by{\tt AUX1}); 
similarly for {\tt AUXB}.
 \end{descr}

%----------------
\glitem{B!CELL}\verb|( bit r c n)|\gltail{:}{CAM-IO}
 \begin{descr}
Stores the bit contained in the first argument to row {\tt
r}, column {\tt c} of bit-plane $n$. Wrap-around occurs if {\tt r} or {\tt c} have
values that exceed 255.
 \end{descr}

%----------------
\glitem{B=A}\gltail{:}{CAM-HOOD}
 \begin{descr}
Copy the current rule and neighborhood assignment used by \cama\ into
\camb.
 \end{descr}

%----------------
\glitem{B@CELL}\verb|( r c n -- bit)|\gltail{:}{CAM-IO}
 \begin{descr}
Returns on the stack the value of the bit in row {\tt r}, column
{\tt c} of bit-plane $n$. Wrap-around occurs if {\tt r} or {\tt c} have
values that exceed 255.
 \end{descr}

%----------------
\glitem{BARE}\gltail{:}{CAM-HOOD}
 \begin{descr}
{\tt MAKE-TABLE BARE} will set the rule for plane 1 to return zeros for
all cases.
 \end{descr}

%----------------
\glitem{BEGIN-MACROS}\gltail{:}{CAM-INT}
 \begin{descr}
Begin defining macros---this allots some space for the machine code, and
puts subsequent Forth definitions after this space, until {\tt USE-MACROS}
is executed.  See also {\tt FORGET-MACROS}, which erases all macros,
leaving only the code generated using them.
 \end{descr}

%----------------
\glitem{BEGIN-SERVICE-STEPS}\gltail{:}{CAM-STEP}
 \begin{descr} Used when \cam\ must perform ``service'' steps extraneous
to the simulation proper; for instance, shifting of bit-planes is
usually done with service steps (see {\tt SEND-SHIFTS}).  Switches all
\cam{}s to begin using an extra set of shadow areas, and saves all
tables for all \cam{}s.

Initially the extra shadow areas are a copy of the normal shadows, so that
color maps, etc., start off the same.  You may change tables,
neighborhoods, and phases; when you are done, {\tt END-SERVICE-STEPS}
will restore \cam's previous state.  All tables, event counts,
neighborhoods, etc. (everything but the contents of the planes) will be
back to what they were before the service steps.
 \end{descr}

%----------------
\glitem{BETA BETA' BETAS}\see{ALPHA}
\loneskip

%----------------
\glitem{BIT-GET}\verb|( bit# n -- bit)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Returns the specified bit of the 16-bit quantity $n$.
 \end{descr}

%----------------
\glitem{BIT-PUT}\verb|( bit bit# n -- n')|\gltail{CODE}{CAM-IO}
 \begin{descr} Store a bit into an indicated position of the 16-bit
quantity $n$.  The modified quantity is returned on the stack.
 \end{descr}

%----------------
\glitem{BLACK}\gltail{:}{CAM-HOOD}
 \begin{descr}
Use during color-map generation (see {\tt MAKE-CMAP}).  Sets the result
for all colors to be off, so that one does not have to explicitly program
any colors that are not used.
 \end{descr}

%----------------
\glitem{BUF-AND}\verb|( s.seg offs d.seg offs #byts)|\gltail{CODE}{CAM-BUF}
\glalso{BUF-OR}
\glalso{BUF-XOR}
 \begin{descr}
{\tt BUF-AND} is the logical {\sc and} of the source segment:offset with the destination. 
Corresponding bytes are {\sc and}ed, and the results are stored back into
the destination.  Similarly for {\tt BUF-OR}, etc.
 \end{descr}

%----------------
\glitem{BUF>MAP}\gltail{:}{CAM-HOOD}
 \begin{descr}
Copies the color-map buffer into the color map---see {\tt MAP>BUF}.
 \end{descr}

%----------------
\glitem{BUF>PDAT}\verb|( pl.msk src.seg offs r0 c0 #rows #byts row.incr)|\gltail{CODE}{CAM-IO}
 \begin{descr} Low-level primitive for all transfers of data from \pc\
memory to \cam.  The plane-mask argument indicates which planes the data
will be written to simultaneously (a value of 3 indicates planes 0 and
1, for example).  The source segment and offset point to the start of
the data, {\tt r0} and {\tt c0} give the upper left corner on the screen
of the region to be written---{\tt r0} is the row, and {\tt c0} is the
column divided by 4 (since columns use nybble addressing).  The number
of rows and bytes to be written on each row are given, and then the row
increment, i.e., the number of \cam\ rows to skip at the end of each row
before writing the next one.

See also {\tt -BUF>PDAT}, {\tt PB>PL}, and {\tt TEMP>PL}.
 \end{descr}

%----------------
\glitem{BUF>TAB}\gltail{:}{CAM-BUF}
 \begin{descr}
Used to copy a precompiled table from a buffer in the \pc's memory to \cam's lookup tables.
All 8 columns ({\tt PLN0}--{\tt PLN3} and {\tt AUX0}--{\tt AUX3}) are copied.  The buffer
starts at {\tt TBUF-SEG:0000}. Cf.\ {\tt TAB>BUF} and {\tt BUF>TDAT}.
 \end{descr}

%----------------
\glitem{BUF>TDAT}\verb|( buf.seg buf.offs first.page #pages)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Low-level primitive used for all writing of table data from \pc\ to \cam.
Complete tables are 10 (hex) pages long, where each page is 100 (hex)
bytes.  A source segment and offset are given, and the first page of the
destination is indicated (usually 0).  See also {\tt TDAT>BUF}, {\tt
BUF>TAB}, and {\tt MAKE-TABLE}.
 \end{descr}

%----------------
\glitem{BUTTONS}\verb|( -- 3bits)|\gltail{:}{CAM-EDIT}
 \begin{descr}
Returns the value (0--7) of the mouse buttons' status.  The high, mid, and
low bits correspond to the left, middle, and right buttons.  \id|0| means
button pressed, \id|1| means button up.
 \end{descr}

%----------------
\glitem{C!CAM}\verb|( val loc#)|\gltail{:}{CAM-IO}
 \begin{descr}
Used to talk directly to \cam\ shadows and hardware.  Can be used in
hardware debugging (naive users should not need to use this).  Normally
writes {\tt val} to shadow-register {\tt loc\#}, which is sent to \cam\
during its next interrupt.  Used in conjuction with {\tt HARD} or with
\cam\ data areas ({\tt PDAT} or {\tt TDAT}) it writes directly to \cam.
See also {\tt CCR}, {\tt AAR}, {\tt TAA}, {\tt TBA}, {\tt PCA}, and {\tt
PRA}.
 \end{descr}

%----------------
\glitem{C@CAM}\verb|( loc# -- val)|\gltail{:}{CAM-IO}
 \begin{descr}
Used to talk directly to \cam\ shadows and hardware.  Can be used in
hardware debugging (naive users should not need to use this).  Normally
reads {\tt val} from shadow-register {\tt loc\#}, which was sent to \cam\
during its last interrrupt.  Used in conjuction with {\tt HARD} or with
\cam\ data areas ({\tt PDAT} or {\tt TDAT}) it reads directly from \cam.
See also {\tt C!CAM}.
 \end{descr}

%----------------
\glitem{CAGE-AREA}\gltail{:}{CAM-BUF}
 \begin{descr}
See {\tt AREA}.
 \end{descr}

%----------------
\glitem{CAM}\gltail{:}{CAM-IO}
 \begin{descr} Select \cam\ (rather than the \pc) as the video source
seen on the display; ignored if you have separate monitors for \cam\ (or
\cam{}s) and the \pc.  See {\tt DISPLAYS} and {\tt PC}.
 \end{descr}

%----------------
\glitem{CAM\#}\verb|( -- addr)|\gltail{VARIABLE}{CAM-IO}
 \begin{descr}
This is the number of the currently selected \cam\ (ranging from 0 to 7,
where 0 is the master \cam\ and 1 thru 7 are slaves).  Most operations
only affect the currently selected \cam. See {\tt FOR-ALL-CAMS} and {\tt
NEXT-CAM} for a discussion of how to change information for all \cam{}s.
 \end{descr}

%----------------
\glitem{CAM-A}\gltail{:}{CAM-HOOD}
\glalso{CAM-B}
\glalso{CAM-AB}
 \begin{descr}
{\tt CAM-A} selects \cama\ as the object of future neighborhood assignments. 
Similarly for {\tt CAM-B}.

{\tt CAM-AB} selects {\sl both} halves of the machine as the target of
neighborhood assignments; this is the default situation, in effect after
executing {\tt NEW-EXPERIMENT}.
 \end{descr}

%----------------
\glitem{CAM-BASE}\verb|( -- addr)|\gltail{VARIABLE}{CAM-INT}
 \begin{descr}
This variable contains the base segment address used by {\tt CAM-INIT} to
set up all addressing of \cam\ data.  Its default value is {\tt DC00}. 
This indicates that up to eight \cam{}s occupy consecutive 2K blocks of
memory beginning at address {\tt DC000}, with the master \cam\ (number 0)
last and the seventh slave first.  This is the variable that must be
changed if the addressing jumpers on \cam{}s are changed, to remap \cam{}s
into another 16K block of memory.  To use a block beginning at {\tt
D0000}, for example, you could type {\tt D000 IS CAM-BASE}
and then save the system using {\tt SAVE-SYSTEM}.
 \end{descr}

%----------------
\glitem{CAM-IRQ\#}\verb|( -- addr)|\gltail{VARIABLE}{CAM-INT}
 \begin{descr}
This variable is used by {\tt CAM-INIT} to set up \cam's vertical-blank
interrupt.  The default value is 2 (\cam\ will use {\sc irq-2}).  This
value must be changed if the {\sc irq} jumper on \cam\ is changed.  Note
that only the jumper on \cam\ 0 (the master) matters (none of the slaves
will cause interrrupts).  See also {\tt CAM-BASE}.
 \end{descr}

%----------------
\glitem{CAM-PTR}\verb|( -- addr)|\gltail{VARIABLE}{CAM-IO}
 \begin{descr}
Pointer to the selected \cam.  See {\tt CAM-SELECT}.
 \end{descr}

%----------------
\glitem{CAM-RESUME}\verb|( -- addr)|\gltail{EQU}{CAM-INT}
 \begin{descr}
This constant points to the beginning of a machine-language subroutine
which causes operation of the \cam\ interrupt service routines to resume
after being suspended by the {\tt CAM-SUSPEND} routine.  This is used to
prevent the interrupt from interfering with foreground machine-code
routines which must temporarily take control of \cam\ machine registers.
 \end{descr}

%----------------
\glitem{CAM-SEG}\verb|( -- segment)|\gltail{:}{CAM-IO}
 \begin{descr}
Returns on the stack the segment value of selected \cam's memory mapped
area. This is used to access \cam's registers as memory locations.
 \end{descr}

%----------------
\glitem{CAM-SELECT}\verb|( cam#)|\gltail{:}{CAM-IO}
 \begin{descr}
Select the active \cam, to which commands are directed. After {\tt
RESET-CAMS}, \cam\ 0 (the master) will be the selected one.  To
perform an operation on all installed \cam{}s, see {\tt FOR-ALL-CAMS}.
{\sl Note that the command {\tt STEP} is always directed to all \cam{}s, no
matter which of them is currently selected.}

See also {\tt SHOW-CAM}, {\tt CAM}, and {\tt PC}.
 \end{descr}

%----------------
\glitem{CAM-SUSPEND}\verb|( -- addr)|\gltail{EQU}{CAM-INT}
 \begin{descr}
Suspend \cam\ operation---see {\tt CAM-RESUME}.
 \end{descr}

%----------------
\glitem{CAMOUT}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``\Cam\ output selection'' bit of \cam's configuration and control
register. See {\tt SET-CCR}.
 \end{descr}

%----------------
\glitem{CAMS}\verb|( #cams)|\gltail{:}{CAM-STEP}
 \begin{descr}
Used to tell the system how many \cam{}s are present.  Non-existent
\cam{}s will be ignored as far as event detection is concerned, and
shadows will not be copied to them (this allows more time during the \cam\
interrupt for other things---see {\tt R/FLY} for example).  The number of
\cam{}s is also used by {\tt FOR-ALL-CAMS}, which you can use to perform
operations on all \cam{}s.  If you set this number to more \cam{}s than
are actually present, the software will service these non-existent \cam{}s
exactly as if they were there---you can do this to try out programs that
are intended to use more \cam{}s than you actually have.

If there are more than four \cam{}s present in the system, the vertical blank
interval will be increased by 8 scan-lines, to give the interrupt more
time. This interval can be set to this longer value manually by executing
{\tt DPYNRM CLR-CCR}. The default length of this interval is determined by the state of
the {\sc variable} {\tt LONG?}, and is restored whenever you execute
{\tt NEW-EXPERIMENT} or {\tt RESET-CAMS}.
 \end{descr}

%----------------
\glitem{CBUF-SEG}\verb|( -- segment)|\gltail{SEGMENT}{CAM-BUF}
 \begin{descr}
This is the 2K segment used for storing the cage's contents.  See also {\tt
CAGE-AREA}.
 \end{descr}

%----------------
\glitem{CCR}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Offset of the ``configuration control'' register within each \cam's shadow
segment.  See {\tt SET-CCR} and {\tt C!CAM}.
 \end{descr}

%----------------
\glitem{CCW CCW' CCWS}\see{CW}
\loneskip

%----------------
\glitem{CCW-PL}\see{NOT-PL}
\loneskip

%----------------
\glitem{CENTER}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{CENTER'}
\glalso{CENTERS}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
 \begin{descr}
The neighbor {\tt CENTER} (the current center of attention) is available as part of
all neighborhoods. Like all other neighbor names, this is a compilation
variable which is set by {\tt MAKE-TABLE} at the beginning of each of the
4096 cases that must be considered to generate a complete table.  The rule
is a Forth word that is a function of these neighbor names, and {\tt
MAKE-TABLE} evaluates it for all possible values of the neighbors.

For a rule-component that is sent to \cama\ (see {\tt >PLN0}, {\tt
>AUX0}) {\tt CENTER} corresponds to the center cell bit of plane 0.
Exactly the same tables can be sent to \camb\ (see {\tt >PLN2},
{\tt >AUX2}), in which case {\tt CENTER}
corresponds to the center cell of plane 2.  For example,
        \begin{verbatim}
    : ID-02   CENTER DUP  >PLN0  >PLN2 ;\end{verbatim}
        would send the identity rule to planes 0 and 2. In fact, as long
as \cama\ and \camb\ have the same neighborhood, it is always possible to
just duplicate the rule result and send it to corresponding subtables on
the two halves of the machine.

Similarly for {\tt CENTER'}, referring to planes 1 or 3.

The ``plural'' version {\tt CENTERS} is the joint form of {\tt CENTER}
and {\tt CENTER'}, and returns the value {\tt CENTER}+2\by{\tt CENTER'}.
 \end{descr}

%----------------
\glitem{CLOSE-DATA}\gltail{:}{CAM-BUF}
 \begin{descr}
Close the currently active data file, and write all changes to disk.  (If
the file isn't closed, some changes may not get written).  Each open data
file must be selected separately and then closed.  See {\tt OPEN-DATA}.
 \end{descr}

%----------------
\glitem{CLR-CCR}\verb|( mask)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Works like {\tt SET-CCR}, but clears the indicated bits to zero, leaving
the rest unchanged.  Bits to be cleared are indicated by {\tt 1}s in the mask.
 \end{descr}

%----------------
\glitem{CMAP}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Offset within each \cam's shadow segment of the beginning of its color
map.  See {\tt MAKE-CMAP}, {\tt BUF>MAP}, {\tt MAP>BUF}, and {\tt C!CAM}.
 \end{descr}

%----------------
\glitem{COL}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
 \begin{descr}
Neighbor in the {\tt N/XPAND} n-hood. Current cell's column position on
the screen, mod 4. See {\tt <ORG-HV>} and {\tt CENTER}.
 \end{descr}

%----------------
\glitem{COLOR-MASK}\verb|( -- addr)|\gltail{VARIABLE}{CAM-HOOD}
 \begin{descr}
{\sc variable} used by {\tt MAKE-CMAP} to generate color maps that have some of
the beams temporarily turned off.  The words {\tt *BEAM} and {\tt +BEAM}
act on the low byte of this mask; the word {\tt INVISIBLE} acts on the
high byte.  During color-map generation, the low and the high bytes of
this mask are {\sc or}ed together, and bits 0--3 of the result are used as
the final mask.  Any 0 in the mask leaves the corresponding beam (0, 1, 2,
3 = blue, green, red, intensity) unaffected, any 1 turns the corresponding
beam off. Color maps are stored in duplicate---an active map and a
copy.  Beams are turned off only in the active map, so that they can later
be turned back on by referring to the copy.

After {\tt NEW-EXPERIMENT}, the {\tt COLOR-MASK} is off.  If any of the
beams have been turned off, all color maps will be generated with the
appropriate beams turned off in the active map.  To cause subsequent color
maps to be generated with all beams turned on, you can use
{\tt COLOR-MASK OFF}.
 \end{descr}

%----------------
\glitem{CW}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{CCW}
\glalso{OPP}
\glalso{CW'}
\glalso{CCW'}
\glalso{OPP'}
\glalso{CWS}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
\glalso{CCWS}
\glalso{OPPS}
 \begin{descr}
Neighbors made available by the {\tt N/MARG}, {\tt N/MARG-HV} and {\tt
N/MARG-PH} major neighborhood assignments. {\tt CW} returns on the stack the value, for the
case under consideration, of the clockwise cell in the Margolus
neighborhood (plane 0 for \cama, 2 for \camb); {\tt CCW}, of the counter-clockwise
neighbor; {\tt OPP}, of the diagonally opposite. (Cf.\ {\tt CENTER} and {\tt MAKE-TABLE}).

Similarly for {\tt CW'}, {\tt CCW'}, and {\tt OPP'}---all referring to planes
1 or 3. 

{\tt CWS}, etc are joint versions.
 \end{descr}

%----------------
\glitem{CW-PL}see {\tt NOT-PL}
\loneskip

%----------------
\glitem{DATA-ADDR}\verb|( n -- addr)|\gltail{:}{CAM-BUF}
 \begin{descr}
Returns the address in memory where the next $n$ bytes of data from the
active data-file (see {\tt OPEN-DATA}) can be found, and advances the data
pointer for that file by $n$.  Uses Forth block-I/O routines, and
so data must be accessed using a record size that divides evenly
into blocks of size 1K (e.g., $n$ could be 8 each time).  See also
{\tt OPEN-DATA}, {\tt CLOSE-DATA}, {\tt GET-DATA}, {\tt PUT-DATA}, and
{\tt REWIND}.  The active data pointer is kept in the double-number {\sc variable}
{\tt DATA-PTR}---this can be manipulated directly to perform random access.
 \end{descr}

%----------------
\glitem{DATA-PTR}\verb|( -- addr)|\gltail{2VARIABLE}{CAM-BUF}
 \begin{descr}
This is the data pointer used by the {\tt OPEN-DATA} command.  It is a
double-number {\sc variable} which points to the next byte of the file to be
retrieved or written.  It is auto incremented as you read or write
data; if you modify it directly, be sure to give it an even value, so
that word reads and writes won't straddle two blocks.  See also {\tt
DATA-ADDR}, {\tt REWIND}, {\tt GET-DATA} and {\tt PUT-DATA}.
 \end{descr}

%----------------
\glitem{DIAG}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Diagnostic bit within \cam's step status register---see {\tt C@CAM}.
 \end{descr}

%----------------
\glitem{DISPLAY-CONTROL}\gltail{VOCABULARY}{CAM-KEYS}
 \begin{descr}
{\tt VOCABULARY} containing the display control {\tt ALIAS} keys.
 \end{descr}

%----------------
\glitem{DISPLAYS}\verb|( #displays)|\gltail{:}{CAM-STEP}
 \begin{descr}
Initialize the hardware for the selected number of displays.  If only a
single display is available, it will be shared between \cam\ and the \pc.
If two displays are available, one is assumed to be dedicated to the \pc\
and the other is shared among the \cam{}s.  If three or more displays are
available, the \pc\ and each \cam\ are treated as if they each have their own
display (see {\tt DISPLAY}).  In this case, the control panel will never
change the setting of the display-multiplexing hardware, though the user
is allowed to. See {\tt CAMOUT} and Appendix \ref{monitor}.
 \end{descr}

%----------------
\glitem{DOS...}\gltail{:}{CAM-KEYS}
 \begin{descr}
Prints the message {\tt (type `exit' to return)} and then executes
{\tt COM} to invoke a copy of the DOS command interpreter.
 \end{descr}

%----------------
\glitem{DOT}\verb|( row col)|\gltail{:}{CAM-EDIT}
 \begin{descr}
Changes the bit at the indicated  row and column without turning
off the display.  Only changes one bit per 60-th of a second---you
probably want to use {\tt B!CELL} and {\tt B@CELL} to draw lines.  The
plane number is selected by changing the variable {\tt DOT-PLN}.
 \end{descr}

%----------------
\glitem{DOT-PLN}\verb|( -- addr)|\gltail{VARIABLE}{CAM-EDIT}
 \begin{descr}
This {\sc variable} contains the current plane number used by {\tt DOT}, and
is used to display the dot-cursor by the \cam\ control panel program.
 \end{descr}

%----------------
\glitem{DOTS,SHIFTS}\gltail{VOCABULARY}{CAM-KEYS}
 \begin{descr}
{\tt VOCABULARY} containing the graphic editing and shift-key {\tt ALIAS}
definitions.
 \end{descr}

%----------------
\glitem{DPYLIN}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Display line'' bit of step status register---see {\tt C@CAM}.
 \end{descr}

%----------------
\glitem{DPYNRM}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Display normal'' bit of \cam's configuration control register---see {\tt
SET-CCR} and {\tt C!CAM}.
 \end{descr}

%----------------
\glitem{DPYRQ}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Display request'' bit of \cam's configuration and control register---see
{\tt SET-CCR} and {\tt C!CAM}.
 \end{descr}

%----------------
\glitem{EAST EAST' EASTS}\see{NORTH}
\loneskip

%----------------
\glitem{ECHO}\gltail{:}{CAM-HOOD}
 \begin{descr}
{\tt MAKE-TABLE ECHO} makes the rule for plane 1 be ``copy the \id|CENTER| of
plane 0.''
 \end{descr}

%----------------
\glitem{ECNT-1}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
\glalso{ECNT-2}
 \begin{descr}
See {\tt EVENT-COUNT}.
 \end{descr}

%----------------
\glitem{ECNT-TOT}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Global variable in the {\tt STEP-SEG}.  See {\tt EVENT-TOT}.
 \end{descr}

%----------------
\glitem{EDITING,RUNNING}\gltail{VOCABULARY}{CAM-KEYS}
 \begin{descr}
{\tt VOCABULARY} containing the {\tt ALIAS} key definitions for editing
screens, loading files, and running experiments.
 \end{descr}

%----------------
\glitem{END-SERVICE-STEPS}\gltail{:}{CAM-STEP}
 \begin{descr}
See {\tt BEGIN-SERVICE-STEPS}.
 \end{descr}

%----------------
\glitem{EQU}\verb|name ( value)|\gltail{:}{CAM-INT}
 \begin{descr}
Makes {\tt name} a constant and sets it to the given value.
 \end{descr}

%----------------
\glitem{EVEN-GRID}\gltail{:}{CAM-HOOD}
 \begin{descr}
Sets both the horizontal and the vertical grid origin position to an even
cell. This word is equivalent to {\tt 0 IS <ORG-HV>} .
 \end{descr}

%----------------
\glitem{EVENT}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Event detected'' bit in \cam's step status register---see {\tt EVENT-COUNT},
{\tt EVENT-TOT} and {\tt C@CAM}.
 \end{descr}

%----------------
\glitem{EVENT-COUNT}\verb|( -- d)|\gltail{CODE}{CAM-STEP}
 \begin{descr} The number of occurrences of an event, returned as a
double number.  Correct usage is to use {\tt NEW-EVENTS} to reset event
pointers, and then run two steps before calling {\tt EVENT-COUNT}.  If
you only start one step and then immediately call {\tt EVENT-COUNT}, the
step you started won't yet have finished, and so there won't yet be
anything to count.  (This is a problem of pipelining your computation to
run at full speed---you must always set up the info for the next step
before the current step has finished.)

If {\tt EVENT-COUNT} is executed and no counts have accumulated since
{\tt NEW-EVENTS} or {\tt EVENT-COUNT} was last executed, an error
message will be printed and execution will be aborted.  If either one or
two counts have accumulated, all is well (the earlier of two counts will
be returned the first time {\tt EVENT-COUNT} is called, the later the
next time it is called); these two counts are kept in {\tt ECNT-1}, {\tt
ECNT-2}.  If more than two counts have accumulated, again an error is
signaled.

The one-byte variable {\tt EVENT-LEN} in the {\tt STEP-SEG} keeps track of
the number of counts that have been accumulated.  If you wish to just read
an event count without keeping track of exactly which step it is
associated with, you can set this variable to one, as in
        \begin{verbatim}
    1 STEP-SEG EVENT-LEN C!L    EVENT-COUNT\end{verbatim}
        which will read the most recent count.  A word which reads the
count at the end of one step, and starts a new step could be defined
as
        \begin{verbatim}
                      : READ-AND-STEP  ( -- d) 
    STEP  EVENT-COUNT ;\end{verbatim}
        Although this looks like we are stepping and then reading, the
count read here by {\tt EVENT-COUNT} will be the one produced by an earlier
step: we are just starting the new step before we look at what we read, so
as not to slow things down.  A loop which runs 100 steps and
examines all the counts could look like this
        \begin{verbatim}
                             : ANALYZE-EVENTS
    NEW-EVENTS STEP  99 0 DO
  READ-AND-STEP ANALYZE LOOP
    IDLE EVENT-COUNT ANALYZE ;\end{verbatim}
        Here {\tt ANALYZE} is some user-defined word which takes a
double number on the stack and does something with it.  The {\tt IDLE} is
there to wait for the last active step to finish---we could instead have
made the loop 100 long, and not read the extra count at the end.

See {\tt OPEN-DATA} if you wish to accumulate data on disk; see also {\tt
EVENT-TOT} and {\tt EVENT-STOP}.
 \end{descr}

%----------------
\glitem{EVENT-HANDLER}\gltail{DEFER}{CAM-IO}
 \begin{descr}
This is a {\tt DEFER}red word that will be called by {\tt WAIT-FOR-PEND}
(and thus indirectly by {\tt STEP} and {\tt IDLE}) if \cam\ stepping has
been stopped because an event of a particular type has occurred (see {\tt
EVENT-MASK} and {\tt EVENT-TYPE}). Initially this word is set by {\tt
NEW-EXPERIMENT} to be a {\tt NOOP} (null operation).  By setting this word
to use a definition of your own, you can take special action when an event
of interest has occured.  After {\tt EVENT-HANDLER} has executed, \cam\
stepping will resume. See {\tt EVENT-STOP}.
 \end{descr}

%----------------
\glitem{EVENT-LEN}\verb|( -- offset)|\gltail{EQU}{CAM-INT}
 \begin{descr}
Offset to the one byte variable in the {\tt STEP-SEG} which keeps track of
how many counts have accumulated since the last execution of {\tt
NEW-EXPERIMENT}, {\tt NEW-EVENTS}, or {\tt EVENT-COUNT}.  This variable is
incremented each time a new count becomes available, and decremented
whenever {\tt EVENT-COUNT} reads a count---it allows {\tt EVENT-COUNT} to
maintain a two-item event stack in order to ensure that no counts are lost
inadvertently.
 \end{descr}

%----------------
\glitem{EVENT-MASK}\verb|( -- offset)|\gltail{EQU}{CAM-INT}
 \begin{descr}
This is a byte in the {\tt STEP-SEG} which controls which \cam's events
can cause stepping to stop.

The least significant bit corresponds to \cam\ 0 (the master).  The
most significant bit corresponds to \cam\ 7 (the seventh slave).  A
value of  {\tt 1} indicates that event detection for the corresponding
\cam\ during the next step may cause stepping to stop (see {\tt
EVENT-TYPE}, {\tt EVENT-STOP}, and {\tt EVENT-HANDLER}).
 \end{descr}

%----------------
\glitem{EVENT-STOP}\verb|( -- offset)|\gltail{EQU}{CAM-INT}
 \begin{descr}
Because of the overlapping of step scheduling and event-count reading that
is necessary to run at full speed, events that occur during one step will
not be detected using {\tt EVENT-COUNT} until after a new step has begun.
This means that the state of \cam\ when the event happened is no longer
available.  If one desires to examine the states of \cam{}s in which certain
events happened, a stop-on-event facility is available which doesn't slow
\cam\ down.

To use this, you should first program the color map and auxiliary tables
so that you detect the event of interest during the step in which the
configuration of interest is being constructed by the updating (see {\tt
SHOW-FUNCTION}).  The variables {\tt EVENT-MASK} and {\tt EVENT-TYPE}
allow you to control which sorts of events (on up to eight \cam{}s
simultaneously) will request that stepping be interrupted.  The variable {\tt
EVENT-STOP} (within the {\tt STEP-SEG}) indicates which \cam\ or \cam's
requested stepping to be interrupted (bit 0 corresponds to the master
\cam, etc.).  As long as the {\tt EVENT-STOP} byte is non-zero, stepping
will be inhibited: the word {\tt WAIT-FOR-PEND}, which is called by {\tt
STEP} and {\tt IDLE}, examines this byte.  If it is non-zero, a {\tt
DEFER}red word {\tt EVENT-HANDLER} is executed, and then {\tt EVENT-STOP}
is cleared.  The normal definition of {\tt EVENT-HANDLER} is a null
operation---by having it execute your own routine you can have whatever
action you wish taken whenever an event of interest occurs.
 \end{descr}

%----------------
\glitem{EVENT-TOT}\verb|( -- quad-number)|\gltail{:}{CAM-STEP}
 \begin{descr} This returns the cumulative count ({\tt ECNT-TOT}) of all
events that have occurred since the last time {\tt NEW-EXPERIMENT} or
{\tt NEW-EVENTS} was called. Before reading the count, it waits for the
completion of up to two steps, namely, (a) a step that may currently be
in progress and/or (b) one to whose execution the step-scheduling
mechanism is irrevocably committed (i.e., one for which the \id|STEP|
command has already been issued). 

The total returned on the stack is a {\em quadruple} number---the high-order
double number is on the top of the stack.  Arithmetic operators for
manipulating quad numbers can be made available by {\tt INCLUDE}ing the
file {\tt QUAD.4TH}.  See also {\tt EVENT-COUNT}.
 \end{descr}

%----------------
\glitem{EVENT-TYPE}\verb|( -- offset)|\gltail{EQU}{CAM-INT}
 \begin{descr}
This is a byte in the {\tt STEP-SEG} segment which, together with {\tt EVENT-MASK},
controls which \cam's events can cause stepping to stop.

The least significant bit corresponds to \cam\ 0 (the master).  The
most significant bit corresponds to \cam\ 7 (the seventh slave).  A
value of  {\tt 0} or {\tt 1} indicates what type of condition (event or
non-event) for the corresponding \cam\ during the next step may cause
stepping to stop (see {\tt EVENT-TYPE} and {\tt EVENT-HANDLER}).
 \end{descr}

%----------------
\glitem{EXEC}\verb|( str)|\gltail{CODE}{PC}
 \begin{descr} Given a pointer to a counted string (which must
be immediately followed by a carriage return character, not
counted as part of the string), {\tt EXEC} will try to execute
it as a DOS command.  A blank string invokes the DOS command
interpreter (from which you return to Forth by typing {\tt
exit}).  Command lines should look like
        \begin{verbatim}
/c  copy a:example b:\end{verbatim}
        (note the extra `{\tt /c}' at the beginning).  After the DOS
command, execution proceeds with the next instruction after {\tt EXEC},
with the stack as it was before the call (except, of course, that {\tt str} has 
been removed).  See also {\tt >DOS} and {\tt COM}.
 \end{descr}

%----------------
\glitem{FILE>IMAGE}\verb|( n #planes)|\gltail{:}{CAM-BUF}
 \begin{descr} Reads an image from disk to \cam\ (used with {\tt
OPEN-PATTERN}).  Plane $n$ is read from the $n$-th 8K record in the
file, then plane $n$+1 from record $n$+1, etc., for the specified number
of planes.  If the file is too short it is wrapped around.  Thus, for
example, if a 2-record file is read to 4 planes, the 2 records are used
for the first two planes, and then again for the second two.  As a
second example, if a single plane starting at 2 is read from a 32K file,
then only record 2 (starting the count from 0) is read and it goes into
plane 2.  See also {\tt IMAGE>FILE}.
 \end{descr}

%----------------
\glitem{FILE>PL}\verb|( n)|\gltail{:}{CAM-BUF}
 \begin{descr}
Used with {\tt OPEN-PATTERN}.  Copy data from the pattern file into the
selected \cam\ plane.  The file is treated as divided into
8K-byte records (this is the size of one bit-plane).  The record $n$
is copied to the plane $n$. File is wrapped around if $n$ is too large.
See also {\tt PL>FILE}.
 \end{descr}

%----------------
\glitem{FILE>TAB}\gltail{:}{CAM-BUF}
 \begin{descr}
Load entire lookup tables from current {\tt TAB} file. Use with {\tt OPEN-TABLE}.
 \end{descr}

%----------------
\glitem{FINISH-CYCLE}\gltail{:}{CAM-STEP}
 \begin{descr} This word is used for cleanly changing from one
run cycle to another (see {\tt MAKE-CYCLE}).  The current run
cycle is run until the end of the Forth word currently attached
as the cycle is encountered.  Then, instead of looping back to
the beginning as usually happens with a step cycle, execution of
the cycle ends and you exit from {\tt FINISH-CYCLE}.  You don't
have to execute this word before executing {\tt MAKE-CYCLE} on a
new word---usually there is no reason to.
 \end{descr}

%----------------
\glitem{FOR-ALL-CAMS}\gltail{:}{CAM-STEP}
 \begin{descr}
Begins a {\tt DO} loop in which the index {\tt I} ranges over the numbers
of all installed \cam{}s. During each iteration, the {\tt I}-th \cam\
is selected.  The end of the loop is indicated by the word {\tt NEXT-CAM}.
As with ordinary {\tt DO} loops, a {\tt FOR-ALL-CAMS} loop can only be
used inside of a colon definition.
 \end{descr}

%----------------
\glitem{FORGET-MACROS}\gltail{:}{CAM-INT}
 \begin{descr}
Forget all Forth words defined since {\tt BEGIN-MACROS} was executed, but
leave the code generated in the dictionary.
 \end{descr}

%----------------
\glitem{FREEZE}\gltail{:}{CAM-HOOD}
 \begin{descr}
{\tt MAKE-TABLE FREEZE} makes the rule for plane 1 be the identity
rule---no other planes are affected.
 \end{descr}

%----------------
\glitem{GENERAL}\gltail{VOCABULARY}{CAM-KEYS}
 \begin{descr}
Vocabulary containing general-purpose key {\tt ALIAS}'es, such as
numbers and a key to exit to Forth.
 \end{descr}

%----------------
\glitem{GET-DATA}\verb|( -- n)|\gltail{:}{CAM-BUF}
 \begin{descr}
Used with \iprog{OPEN-DATA}.  Get the next sequential 16-bit quantity from the current
data file.
 \end{descr}

%----------------
\glitem{GET-TIME}\verb|( -- d)|\gltail{CODE}{CAM-LOAD}
 \begin{descr} Returns time of day as a double number on the stack.  The top number
contains the hours (high byte) and minutes (low byte); the other
number contains seconds (high byte) and 1/100-th seconds (low
byte).
 \end{descr}

%----------------
\glitem{GO}\gltail{:}{CAM-KEYS}
 \begin{descr}
Resume stepping. See {\tt STOP}.
 \end{descr}

%----------------
\glitem{GOTO-K}\gltail{:}{CAM-KEYS}
 \begin{descr}
Go to the \cxp\ program.  Exits from
whatever operation was going on (such as loading) and starts up the
control panel.
 \end{descr}

%----------------
\glitem{H1}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
 \begin{descr}
Pseudo-neighbor available as part of the {\tt N/XPAND} neighborhood. 
Returns the second least significant bit of the horizontal position of the
center cell.  See also {\tt HORZ} and {\tt COL}.
 \end{descr}

%----------------
\glitem{HALF}\gltail{CONSTANT}{CAM-KEYS}
 \begin{descr}
Returns the constant value 32,762 (8000 in hex), which is half the number of cells
on the \cam\ screen.
 \end{descr}

%----------------
\glitem{HARD}\verb|( loc -- hard-loc)|\gltail{:}{CAM-IO}
 \begin{descr}
Used in conjuction with {\tt C@CAM} and {\tt C!CAM} to talk directly to
hardware registers.  For example,
        \begin{verbatim}
    5 AAR C!CAM\end{verbatim}
        would write 5 to the shadow variable associated with the {\tt
AAR} register (which will be sent to \cam\ when it interrupts next), while
        \begin{verbatim}
    5 AAR HARD C!CAM\end{verbatim}
        would write directly to the \cam\ hardware {\tt AAR} register
of the currently selected \cam.
 \end{descr}

%----------------
\glitem{HGLUE}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Horizontal glue'' bit of configuration control register.  Set it for all
\cam's that are to be glued horizontally---they will then make use of the
signals coming into their horizontal glue connectors.  Vertical gluing
works in a similar fashion.  See {\tt VGLUE}, {\tt SET-CCR}, and {\tt C!CAM}.
 \end{descr}

%----------------
\glitem{HMASK}\verb|( -- addr)|\gltail{VARIABLE}{CAM-STEP}
 \begin{descr}
{\sl Hold} mask.  The four low-order bits of this variable constitute a mask
that is used by the \cam\ control panel program when it calls {\tt
SEND-SHIFTS} in response to the arrow keys. Normally, tables for four
different shifts are sent for each bit-plane; if a bit of {\tt HMASK} is
set, an identity rule (no change) is sent as the table for the
corresponding plane.  Thus the indicated planes are held fixed, while the
rest of the planes are free to shift.
 \end{descr}

%----------------
\glitem{HORZ}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{VERT}
\glalso{HV}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
 \begin{descr}
Pseudo-neighbors made available by the {\tt N/MARG-HV} major neighborhood
assignment.  {\tt HORZ} returns the horizontal parity of the position of the cell
currently being updated, relative to an origin set by {\tt <ORG-HV>}.
{\tt VERT} does the same for the vertical position, and {\tt HV} returns
the joint value {\tt HORZ}+2\by{\tt VERT}.
 \end{descr}

%----------------
\glitem{HRUN}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Horizontal run'' bit of the step status register.  See {\tt SSR}.
 \end{descr}

%----------------
\glitem{HV}\see{HORZ}
\loneskip

%----------------
\glitem{IDLE}\gltail{:}{CAM-STEP}
 \begin{descr}
Execute one {\sl idle} step on \cam, during which display occurs but there is no updating
of cell states.  All shadow data is transferred, just as for an active
step (color maps, neighborhood assignment, reading or writing planes during
the vertical blank interval, etc);  event-counts and step-counts are not
affected. {\tt IDLE} steps can be (and are) used for controling \cam's
speed.  When {\tt IDLE} is used inside of a run cycle, it causes an exit
just as {\tt STEP} does.  See also {\tt IDLES}.
 \end{descr}

%----------------
\glitem{IDLES}\verb|( n)|\gltail{:}{CAM-STEP}
 \begin{descr}
Execute {\tt IDLE} $n$ times.
 \end{descr}

%----------------
\glitem{IMAGE>FILE}\verb|( n #planes)|\gltail{:}{CAM-BUF}
 \begin{descr}
Used with {\tt OPEN-PATTERN}.  Saves the image as consecutive 8K records,
with no special header information.  See {\tt FILE>IMAGE}.
 \end{descr}

%----------------
\glitem{IMOVE}\verb|( src.seg offs dest.seg offs #byts)|\gltail{CODE}{CAM-BUF}
 \begin{descr}
The same as {\tt LMOVE}, but no interrupts are allowed to occur during the
move---the block of data is moved as an indivisible unit.
 \end{descr}

%----------------
\glitem{INCLUDE}\verb|name|\gltail{:}{CAM-BUF}
 \begin{descr}
Used to include the entire contents of another file as if it appeared at
the indicated point.  Used, for example, with \iprog{AUTOCORR.4TH} when
you want to run an autocorrelation experiment, and with \iprog{DOS2.4TH}
if you want to use the {\tt DOS2} file interface. (Also \iprog{QUAD.4TH}
to load the quadruple-precision arithmetic words).
 \end{descr}

%----------------
\glitem{INVISIBLE}\verb|( mask)|\gltail{:}{CAM-HOOD}
 \begin{descr}
{\tt TRUE INVISIBLE} temporarily turns off all beams of the display,
while {\tt FALSE INVISIBLE} turns them back on without losing track
of which beams were toggled off by {\tt *BEAM}.  See {\tt COLOR-MASK}.
 \end{descr}

%----------------
\glitem{IRGB}\verb|( -- 4bits)|\gltail{CODE}{CAM-HOOD}
 \begin{descr}
Color-map compilation variable.  Returns the value that will be used as
the current entry if no further changes are made.  See also {\tt >IRGB}
and {\tt MAKE-CMAP}.
 \end{descr}

%----------------
\glitem{IRGB-MAP}\gltail{:}{CAM-HOOD}
 \begin{descr}
Color map (see {\tt MAKE-CMAP}) that associates a separate color ``beam''
with each of the four bit-planes (or auxiliary table outputs---see {\tt
SHOW-FUNCTION}).  Planes 0, 1, 2, 3 correspond to intensity, red, green,
and blue respectively.
 \end{descr}

%----------------
\glitem{LDTBL}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Load table'' bit of the configuration control register. See {\tt
MAKE-TABLE} and {\tt CCR}.
 \end{descr}

%----------------
\glitem{LL LR LL' LR' LLS LRS}\see{UL}
\loneskip

%----------------
\glitem{LONG?}\verb|( -- addr)|\gltail{VARIABLE}{CAM-STEP}
 \begin{descr}
{\sc variable} used by {\tt RESET-CAMS} to determine the default number of lines
in a scan frame. If more than four \cam{}s are installed, this variable is
ignored and the longest frame is used.  On monitors where the top or bottom edges
of the plane array are not visible, adding extra blank lines to the frame makes
more of the display visible (you may have to adjust the vertical-size control
in the monitor to take full advantage of this feature).

See {\tt CAMS}.
 \end{descr}

%----------------
\glitem{MAKE-CMAP}\verb|name|\gltail{:}{CAM-HOOD}
 \begin{descr} Makes a new color map (see Section \ref{color-map}).
{\tt MAKE-CMAP} actually generates two copies of the color map (each
nybble representing a color is stored twice, so that each of the 16 cases
takes up a byte).  One of the copies is the active map, which is sent to
\cam; the other is used to restore the active map when beams have been
temporarily turned off (see {\tt COLOR-MASK}, {\tt *BEAM}, and {\tt
INVISIBLE}).
 \end{descr}

%----------------
\glitem{MAKE-CYCLE}\verb|name|\gltail{:}{CAM-STEP}
 \begin{descr} Used to attach a Forth word as the active run cycle (see
Section \ref{run-cycle}.  The run cycle will be executed as a
co-routine by the control panel.  The purpose of the run cycle is to
modify \cam\ parameters in a regular cycle in between steps.  For
example,
    \begin{verbatim}
                               : BB-CYCLE
                EVEN-GRID STEP
                 ODD-GRID STEP ;
    MAKE-CYCLE BB-CYCLE \end{verbatim}
will attach {\tt BB-CYCLE} as the active run cycle.  Each time  
the Forth word {\tt NEXT-STEP} is executed, {\tt BB-CYCLE} will continue  
execution up to the next occurence of the word {\tt STEP}, at which point  
execution of the cycle will be suspended with all parameters for the next  
step prepared, but the new step not yet started.

When {\tt BB-CYCLE} is first attached by {\tt MAKE-CYCLE}, {\tt EVEN-GRID}  
is executed and the execution is suspended.  The first time that {\tt  
NEXT-STEP} is executed, {\tt STEP} and {\tt ODD-GRID} are executed, and  
then execution is suspended.  The second time {\tt NEXT-STEP} is executed,  
{\tt STEP} and {\tt EVEN-GRID} are executed, etc. (when you reach the end of
{\tt BB-CYCLE}, execution wraps around to the beginning).
 \medskip
 \noindent Note that:
\begin{itemize}
 \item {\tt NEXT-STEP} is the word that is executed when you run steps  
from the control panel.
 \item This co-routine has a separate stack from the rest of Forth.
 \item The default run cycle, which is attached whenever you execute {\tt  
NEW-EXPERIMENT}, is just the word {\tt STEP}.
 \item Since the run cycle begins to execute when you say {\tt MAKE-CYCLE}
(up to the first occurrence of {\tt STEP} or {\tt IDLE}) you should be careful
that the experiment does not modify parameters (such as neighborhood assignments)
initialized by the cycle.
 \end{itemize}
 \end{descr}

%----------------
\glitem{MAKE-TABLE}\verb|name|\gltail{:}{CAM-HOOD}
 \begin{descr}
Used to generate a lookup table from a rule-word, and to send it to \cam\
(see Section \ref{table-generation}).
 \end{descr}

%----------------
\glitem{MAP>BUF}\gltail{:}{CAM-HOOD}
 \begin{descr}
Saves the color map table in the color-map buffer. See {\tt BUF>MAP}.
 \end{descr}

%----------------
\glitem{MOUSE-INIT}\gltail{:}{CAM-EDIT}
 \begin{descr}
Initialize the mouse interface if present.
 \end{descr}

%----------------
\glitem{MOUSE-IRQ\#}\gltail{VARIABLE}{CAM-EDIT}
 \begin{descr}
Variable containing the interrupt-request number for the mouse. Default value is 4.
 \end{descr}

%----------------
\glitem{MOUSE-POS}\verb|( -- row col)|\gltail{:}{CAM-EDIT}
 \begin{descr}
Returns current mouse row and column (or position determined by arrow
keys).
 \end{descr}

%----------------
\glitem{MOUSE>ORG}\verb|( -- delta-row delta-col)|\gltail{:}{CAM-KEYS}
 \begin{descr}
Resets the mouse to be at the origin (center of the screen), and returns
the amount of row- and column-shift used.
 \end{descr}

%----------------
\glitem{N.EAST}
\glalso{N.WEST}
\glalso{S.EAST}
\glalso{S.WEST}

 \begin{descr}
Neighbors made available by the {\tt N/MOORE} and the {\tt N/CORNERS} major
assignments (cf.\ {\tt CENTER}).
During table compilation, {\tt N.EAST} returns the value of the north-east neighbor on plane 0 or 2,
etc.

No primed or joint versions of these neighbors exist in any of the standard
neighborhoods.
 \end{descr}

%----------------
\glitem{N/CORNERS}\gltail{:}{CAM-HOOD}
 \begin{descr}
Major neighborhood assignment, consisting of {\tt CENTER}, {\tt CENTER'}, four corners ({\tt N.EAST},
etc.), and four user neighbors (address lines 6, 7, 8, and 9). See {\tt ==}.
 \end{descr}

%----------------
\glitem{N/MARG}\gltail{:}{CAM-HOOD}
 \begin{descr}
Major neighborhood, consisting of the neighbors {\tt CENTER CENTER' CW CW'
CCW CCW' OPP OPP'} along with their joint versions.  Neighbors number 8
and 9 are left as user neighbors---see {\tt ==}.
 \end{descr}

%----------------
\glitem{N/MARG-HV}\gltail{:}{CAM-HOOD}
 \begin{descr}
{\tt N/MARG} neighborhood, with {\tt HORZ} and {\tt VERT} (and their joint
version {\tt HV}) added.
 \end{descr}

%----------------
\glitem{N/MARG-PH}\gltail{:}{CAM-HOOD}
 \begin{descr}
{\tt N/MARG} neighborhood, with the pseudo-neighbors {\tt PHASE} and {\tt
PHASE'} (and the joint version {\tt PHASES}) added.
 \end{descr}

%----------------
\glitem{N/MOORE}\gltail{:}{CAM-HOOD}
 \begin{descr}
Major neighborhood, consisting of the nine neighbors in a 3\by3 region on
plane 0 (\cama) or plane 2 (\camb), plus the center cell on the other
plane in the same half of \cam.  The neighbors consist of the four corner
neighbors of {\tt N/CORNERS} plus the four side neighbors {\tt NORTH SOUTH
WEST EAST}, and of course {\tt CENTER} and {\tt CENTER'}, which are part
of every neighborhood.  Only one joint neighbor, {\tt CENTERS}, is
available.
 \end{descr}

%----------------
\glitem{N/NSWE'}\gltail{:}{CAM-HOOD}
 \begin{descr}
Major neighborhood, consisting of the four side neighbors {\tt NORTH'
SOUTH' EAST' WEST'}, the usual center cells, and four user neighbors
(address lines 6, 7, 8, and 9).
 \end{descr}

%----------------
\glitem{N/USER}\gltail{:}{CAM-HOOD}
 \begin{descr} Major neighborhood; attaches address lines
2--9 to user-connector inputs UA2--UA9 (for \cama) or UB2--UB9 (for
\camb); as in all other neighborhoods, lines 0 and 1 are connected to
{\tt CENTER} and {\tt CENTER'}.  This is the default neighborhood used
if no other major assignment is made.

See the description of {\tt ==} for an example of how to give names to user
neighbors for use in rules.
 \end{descr}

%----------------
\glitem{N/VONN}\gltail{:}{CAM-HOOD}
 \begin{descr}
Major neighborhood, consisting of {\tt NORTH NORTH' SOUTH SOUTH' WEST
WEST' EAST EAST'} along with the centers and the joint neighbors for all
of these ({\tt NORTHS} etc.).
 \end{descr}

%----------------
\glitem{N/XPAND}\gltail{:}{CAM-HOOD}
 \begin{descr}
Major neighborhood.  This is a specialized neighborhood that is
supported mainly for use in the expanded-display mode.  It makes available
the neighborhood words {\tt ROW} and {\tt COL}, which allow the rule to
know the position (mod 4) of the current cell on the screen, and the
neighbors {\tt NORTH' SOUTH' WEST' EAST' CENTER'} and {\tt CENTER}.
 \end{descr}

%----------------
\glitem{NEW-EVENTS}\gltail{:}{CAM-STEP}
 \begin{descr}
Initializes event counts and stack information that tells subsequent {\tt
EVENT-COUNT} whether or not any events have been missed (because you
didn't read them).  It also resets {\tt EVENT-TOT}, the cumulative count,
to zero.
 \end{descr}

%----------------
\glitem{NEW-EXPERIMENT}\gltail{:}{CAM-KEYS}
 \begin{descr}
This is the word that is normally used to begin an experiment.  It uses
{\tt NEWX} to erase  all definitions from the previous experiment (but see
{\tt PERMANENT}) and resets \cam\ to a standard state with {\tt
RESET-CAMS}.
 \end{descr}

%----------------
\glitem{NEW=0}\gltail{:}{CAM-HOOD}
 \begin{descr}
Used during table generation to clear all parts of the current entry
(corresponding to all primary and all auxiliary table outputs) to zero. 
Otherwise, all parts of the current entry which are not explicitly set to
some new value are left unchanged.  See {\tt MAKE-TABLE}.
 \end{descr}

%----------------
\glitem{NEW=AA}\gltail{CODE}{CAM-HOOD}
 \begin{descr} 
Used within a table definition.  Copies the \cama\ part
of a table entry into the \camb\ part.  For example, {\tt \noindent
MAKE-TABLE NEW=AA} would make the table for \camb\ be a copy of that for
\cama.

\noindent Note: This copies the table, but not the neighborhood
assignment. See {\tt B=A} for a complete copy.
 \end{descr}

%----------------
\glitem{NEW=BA}\gltail{CODE}{CAM-HOOD}
 \begin{descr}
Interchanges the \cama\ and \camb\ halves of a table entry.
{\tt MAKE-TABLE NEW=BA} would interchange the complete tables.  See {\tt NEW=AA}.
 \end{descr}

%----------------
\glitem{NEW=BB}\gltail{:}{CAM-HOOD}
 \begin{descr}
Make both halves of the table entry copies of the \camb\ half.  See {\tt
NEW=AA}.
 \end{descr}

%----------------
\glitem{NEW=TBUF}\gltail{:}{CAM-HOOD}
 \begin{descr}
Copies the new entry from the table buffer.  This allows you to generate
tables that are a function of the contents of the table buffer.
 \end{descr}

%----------------
\glitem{NEWX}\gltail{DEFER}{CAM-KEYS}
 \begin{descr}
This is an abbreviated version of {\tt NEW-EXPERIMENT} that doesn't reset
\cam---it just erases the old experiment from the Forth dictionary.
 \end{descr}

%----------------
\glitem{NEXT-CAM}\gltail{:}{CAM-STEP}
 \begin{descr}
End of a {\tt FOR-ALL-CAMS} \ldots {\tt NEXT-CAM} cycle. See {\tt
FOR-ALL-CAMS}.
 \end{descr}

%----------------
\glitem{NEXT-CYCLE}\gltail{:}{CAM-STEP}
 \begin{descr} Continue executing the run cycle without stopping until you reach the end of
it (see {\tt MAKE-CYCLE}) and wrap around to the beginning of it; then
stop at the first occurence of {\tt STEP} or {\tt IDLE}).
 \end{descr}

%----------------
\glitem{NEXT-STEP}\gltail{CREATE-PRO}{CAM-STEP}
 \begin{descr}
Continue executing the run cycle (see {\tt MAKE-CYCLE}), stopping at the
next occurence of {\tt STEP} or {\tt IDLE}).
 \end{descr}

%----------------
\glitem{NORTH}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{SOUTH}
\glalso{EAST}
\glalso{WEST}
\glalso{NORTH'}
\glalso{SOUTH'}
\glalso{EAST'}
\glalso{WEST'}
\glalso{NORTHS}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
\glalso{SOUTHS}
\glalso{EASTS}
\glalso{WESTS}

 \begin{descr}
{\tt NORTH} is a neighbor for plane 0 (\cama) or plane 2 (\camb) made available
by the major neighborhood assignments {\tt N/VONN} and {\tt N/MOORE}; {\tt NORTH'}
is for planes 1 or 3 (cf.\ {\tt CENTER}). Similarly for {\tt SOUTH}, {\tt EAST}, and {\tt WEST}.

{\tt NORTHS} etc.\ are joint versions.
 \end{descr}

%----------------
\glitem{NOT-PL}\verb|( n)|\gltail{:}{CAM-BUF}
\glalso{$\backslash$-PL}
\glalso{/-PL}
\glalso{CW-PL}
\glalso{CCW-PL}
\glalso{RND>PL}
\glalso{S/S-PL}
\glalso{T/B-PL}
\glalso{VAL>PL}\verb|( val n)|
\glalso{RND>PL}\verb|( exp n)|
 \begin{descr}
{\tt NOT-PL} performs the logical {\sc not} function on plane $n$.

{\tt $\backslash$-PL} flips the plane across the main
diagonal (upper-left/lower-right), {\tt /-PL} across the secondary
diagonal (lower-left/upper-right).

{\tt S/S-PL} Flips the plane from side to side, {\tt T/B-PL} from
top to bottom.

{\tt CW-PL} Rotates the plane one-quarter turn clockwise, {\tt
CCW-PL} counter-clockwise.

{\tt VAL>PL} Fills the plane with repetitions of the 16-bit pattern {\tt val}.

{\tt RND>PL} Generates a random pattern where the
expected number of {\tt 1}s (over the whole bit-plane) is {\tt exp}.

See also {\tt AND>PL}.

\smallskip

All the above plane operations affect only the {\sl active}
region of the plane, determined by {\tt AREA}
or a word that calls {\tt AREA} (such as {\tt WHOLE-AREA} or {\tt
CAGE-AREA}).  See {\tt AREA} for details.
 \end{descr}

%----------------
\glitem{ODD-GRID}\gltail{:}{CAM-HOOD}
 \begin{descr}
Sets both horizontal- and vertical-grid origins to the odd value.
This word is equivalent to 
        \begin{verbatim}
    3 IS <ORG-HV>\end{verbatim}
 \end{descr}

%----------------
\glitem{OPEN-DATA}\verb|filename|\gltail{:}{CAM-BUF}
 \begin{descr} Open a {\em data} file named {\tt filename} (to be used for
reading or numbers as 16-bit words using \iprog{GET-DATA} and
\iprog{PUT-DATA}) and create a Forth word {\tt filename} that will be
used for making this file the ``current'' data file.  The declaration
\id|OPEN-DATA filename| {\sl must not} occur inside of a {\sc colon}
definition. No default extension is supplied; if an extension
is desired (\id|DAT| is the recommended extension for data files)
it should be typed as part of {\tt filename}.

As many data files as desired may be simultaneously open.  Whenever
executed, the word {\tt filename} (which {\sl may} occur in {\sc colon}
definitions) changes the currently selected data file to {\tt filename}
and restores the position pointer within the file to the place where it
was at when you last selected that data file (since it was opened by
\iprog{OPEN-DATA}).  When a data file are opened, the pointer is at set
at the beginning of the file.  You should use the Forth word
\iprog{CREATE-FILE} (it takes the size in 1K blocks as an argument) to
create the file before you use it.  See also {\tt CLOSE-DATA} and {\tt
DATA-ADDR}.
 \end{descr}

%----------------
\glitem{OPEN-PATTERN}\verb|filename|\gltail{:}{CAM-BUF}
 \begin{descr} Open a {\em pattern} file named {\tt filename} for
reading or writing plane data (using {\tt FILE>IMAGE}, {\tt IMAGE>FILE},
{\tt FILE>PL}, and {\tt PL>FILE}.  Works analogously to {\tt OPEN-DATA}.
The recommended extension for pattern files is \id|PAT| (this extension
is provided by default when you {\em Get from disk} or {\em Put to disk}
\cam\ planes directly from the \cp; cf.\ Section \ref{disk-io}).
 \end{descr}

%----------------
\glitem{OPEN-TABLE}\verb|filename|\gltail{:}{CAM-BUF}
 \begin{descr} Open a {\em table} file named {\tt filename} for reading
or writing precompiled lookup tables (using {\tt FILE>TAB} and {\tt
TAB>FILE}).  Works analogously to {\tt OPEN-DATA}.  The recommended
extension for table files is \id|TAB| (this extension
is provided by default when you {\em Save tables} or {\em Load tables}
directly from the \cp; cf.\ Section \ref{tab-files}).
 \end{descr}

%----------------
\glitem{OPP OPP' OPPS}\see{CW}
\loneskip

%----------------
\glitem{OR>PL}\see{AND>PL}
\loneskip

%----------------
\glitem{ORDER}\gltail{:}{CAM-KEYS}
 \begin{descr}
Lists the {\tt CURRENT} and {\tt CONTEXT} vocabularies, and also which
vocabulary {\tt ALIAS}'es are put into.
 \end{descr}

%----------------
\glitem{ORS}\see{STORES}
\loneskip

%----------------
\glitem{P*BUF}\see{AND>PL}
\loneskip

%----------------
\glitem{PAIR}\verb|( a b -- a+2b)|\gltail{CODE}{CAM-HOOD}
 \begin{descr}
        Used to construct joint neighbors, as in
\begin{verbatim}
    : CENTERS  CENTER CENTER' PAIR ;\end{verbatim}
        It can also be used repeatedly to join a group of one-bit items on the
stack into a single binary number.
 \end{descr}

%----------------
\glitem{PB>PL PBS>PLS}\see{AND>PL}
\loneskip

%----------------
\glitem{PBUF-SEG}\verb|( -- segment)|\gltail{SEGMENT}{CAM-BUF}
 \begin{descr}
Returns on the stack the value of the plane-buffer memory segment. This
buffer is a memory area of 4\by8K bytes that starts at location {\tt
PBUF-SEG:0000}.
 \end{descr}

%----------------
\glitem{PC}\gltail{:}{CAM-IO}
 \begin{descr}
Use the video output of the \pc\ rather than \cam\ as the signal to be
sent to the monitor.  This has effect only when a single display is being
shared between \cam\ and the \pc.  See {\tt DISPLAYS}, {\tt CAM},
{\tt CAM-SELECT}, and {\tt SHOW-CAM}.
 \end{descr}

%----------------
\glitem{PCA}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Offset of ``plane column address'' register within each \cam's shadow segment.
This register always contains the column address that will result in a
stationary picture if used for the next step; thus, it can be incremented
or decremented to obtain desired effects.  For example,
{\tt PCA C@CAM  2+  PCA C!CAM}
would result in the configuration on the currently selected \cam\ being 
shifted 2 nybbles (an 8-cell width) to the left.  Note that the column
address register contains a nybble address; this is different from the row
address register {\tt PRA} which contains a bit address:
{\tt PRA C@CAM  2+  PRA C!CAM} would result in a shift up of only two cell positions.
 \end{descr}

%----------------
\glitem{PDAT}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
{\sc Cam}'s plane data area. See {\tt BUF>PDAT}, {\tt B!CELL}, and {\tt
C!CAM}.
 \end{descr}

%----------------
\glitem{PDAT>BUF}\verb|( n dest.seg offs r0 c0 #rows #byts row.incr)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Low-level primitive used for all reading of data from plane $n$ into the \pc\
memory. Arguments have the same meanings as for {\tt BUF>PDAT} (except that
the segment is a destination, rather than a source).  See also {\tt
-PDAT>BUF}, {\tt PL>PB}, and {\tt PL>TEMP}.
 \end{descr}

%----------------
\glitem{PEND}\gltail{:}{CAM-IO}
 \begin{descr}
Sets the {\tt STEP-PENDING} shadow variable to {\tt TRUE}.  This variable
will be cleared the next time the shadows are copied to \cam\ 
(usually every 60-th of a second).  See {\tt WAIT-FOR-PEND}.  This
word is used by {\tt STEP} and {\tt IDLE}.
 \end{descr}

%----------------
\glitem{PERMANENT}\gltail{:}{CAM-LOAD}
 \begin{descr}
{\tt NEW-EXPERIMENT} normally erases all user-defined words from the 
Forth dictionary (as does {\tt NEWX}).  However, if the word {\tt
PERMANENT} is executed, all words in the dictionary at that moment become
permanent, and will not be forgotten if {\tt NEW-EXPERIMENT} or {\tt NEWX}
is subsequently executed.  To forget words you have added to the permanent
part of the dictionary, you can use the word {\tt FORGET}, as in
\begin{verbatim}
    FENCE OFF  FORGET name  PERMANENT\end{verbatim}
where {\tt name} could be any Forth word.  To make changes
to the system more permanent, you can save a new version of the system
using {\tt SAVE-SYSTEM}.
 \end{descr}

%----------------
\glitem{PERMUTE}\verb|( new3 new2 new1 new0)|\gltail{:}{CAM-KEYS}
 \begin{descr}
The four numbers on the stack specify which planes should to be copied as the
new contents of the four planes.  For example, 
        \begin{verbatim}
    3 2 0 1 PERMUTE\end{verbatim}
        would interchange planes 0 and 1 and leave the other two
unchanged;
\begin{verbatim}
    1 1 1 1 PERMUTE\end{verbatim}
isn't really a permutation---plane 1 is copied onto all planes. 
Note that, as with other plane operations, the action of {\tt PERMUTE} is restricted
to the {\sl active} region of the planes  (cf.\ {\tt NOT-PL}); the remainder of each plane
(if any) is left unchanged.
 \end{descr}

%----------------
\glitem{PHASE}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
\glalso{PHASE'}
\glalso{PHASES}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
 \begin{descr}
Pseudo-neighbors made available by {\tt N/MARG-PH}.  The value that
the Forth pseudo-variable {\tt <PHASE>} had immediately before a step is
begun can be seen during that step by all cells through this neighbor.
Similarly for {\tt PHASE'}. {\tt PHASES} is their joint version.
Cf.\ {\tt \&PHASE}.
 \end{descr}

%----------------
\glitem{PL>FILE}\verb|( n)|\gltail{:}{CAM-BUF}
 \begin{descr}
Used with \iprog{OPEN-PATTERN}.  See \prog{FILE>PL}.
 \end{descr}

%----------------
\glitem{PL>PB}\see{AND>PL}
\loneskip

%----------------
\glitem{PL>TEMP}\verb|( n)|\gltail{:}{CAM-BUF}
 \begin{descr}
Moves data from the active region of plane $n$ to the
temporary-buffer area.  See {\tt /-PL}.
 \end{descr}

%----------------
\glitem{PLANE-OPS}\gltail{VOCABULARY}{CAM-KEYS}
 \begin{descr} Vocabulary containing \cxp\ commands
for operations on \cam's bit-planes (cf.\ Chapter \ref{pledit}).
 \end{descr}

%----------------
\glitem{PLN0}\verb|( -- bit)|\gltail{=NEW}{CAM-HOOD}
\glalso{PLN1}
\glalso{PLN2}
\glalso{PLN3}
\glalso{PLNA}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
\glalso{PLNB}
 \begin{descr}
The current value, in the entry under construction, of the bit(s) to be sent
to the correponding table column(s).  See {\tt >PLN0} and {\tt MAKE-TABLE}.
 \end{descr}

%----------------
\glitem{PLS>PBS}\see{\tt AND>PL}
\loneskip

%----------------
\glitem{PRA}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Offset of ``Plane row address'' register. See {\tt PCA}.
 \end{descr}

%----------------
\glitem{PUT-DATA}\verb|( n)|\gltail{:}{CAM-BUF}
 \begin{descr}
See \prog{GET-DATA}, and \prog{REWIND}. Write $n$ to next
location of active data file and autoincrement \prog{DATA-PTR}.
 \end{descr}

%----------------
\glitem{R-INIT}\gltail{:}{CAM-BUF}
 \begin{descr}
Initializes the random number generator to a standard state.
 \end{descr}

%----------------
\glitem{R/FLY}\verb|( data-buf.seg data-buf.offs n ptr-buf #items len)|\gltail{:}{CAM-IO}
 \begin{descr}
Read \cam\ data on the fly.  Used to read plane data during vertical-blank
interrupt without affecting stepping or display.  Along with {\tt
W/FLY}, this is used to produce the dot and cage cursors.

The pointer buffer {\tt ptr-buf} located within the {\tt FORTH-SEG}
contains one row/column pointer for each data item to be read.  As each
data item is read, {\tt len} bytes are appended to the data buffer which
starts at {\tt data-buf.seg:data-buf.offs}.  All items are read
from the same plane $n$.

The arguments and operation of {\tt W/FLY} (write on the fly) are
similar---only the direction of data movement between planes and data
buffer is reversed.
In both cases, the high-order byte of {\tt \#items} is used as
an additional argument.  If this byte is zero, the transfer of the
color maps for all \cam's from the shadow registers is suppressed before
the step during which the {\tt R/FLY} or {\tt W/FLY} operation takes
place, to give extra time during the interrupt for reading or writing
plane data.  The maximum number of items which can be read or written
during a single interrupt is 10 (hex).

See also {\tt DOT}, {\tt B@CELL}, and {\tt PL>PB}.  Cumulative information
about plane contents can also be obtained without slowing down the
updating or hindering the display using the event counters (see {\tt
EVENT-COUNT}).
 \end{descr}

%----------------
\glitem{REG-TABS}\gltail{:}{CAM-HOOD}
 \begin{descr}
Used to select the regular tables for both \cama\ and \camb.  This is
useful in a run cycle---see also {\tt AUX-TABS}, {\tt <TAB-A>} and {\tt
MAKE-CYCLE}.
 \end{descr}

%----------------
\glitem{RESET-CAMS}\gltail{:}{CAM-STEP}
 \begin{descr}
This word is called by {\tt NEW-EXPERIMENT} and by {\tt DISPLAYS}.  It
resets all \cam{}s to a standard state, by doing the following:
 \begin{itemize}
 \item setting up the default neighborhoods {\tt N/USER} and{\tt \&/USER}
 \item setting up the default tables (zero for all planes -- see {\tt
MAKE-TABLE})
 \item setting up the default run cycle (to {\tt STEP}; see {\tt
MAKE-CYCLE})
 \item setting up the default color map (to {\tt STD-MAP}; see {\tt
MAKE-CMAP})
 \item clearing all planes (but not the plane buffers) to zeros 
 \item setting up the default number of lines in a frame (see {\tt LONG?}).
 
 \item selecting \cam\ 0 (the master \cam) as the current one (see {\tt
CAM-SELECT})
 \end{itemize}
 \end{descr}

%----------------
\glitem{REWIND}\gltail{:}{CAM-BUF}
 \begin{descr}
Used to reset \iprog{DATA-PTR} to zero.  See \prog{OPEN-DATA}.
 \end{descr}

%----------------
\glitem{RND}\verb|( -- n)|\gltail{CODE}{CAM-BUF}
 \begin{descr}
Returns a 16-bit random number.
 \end{descr}

%----------------
\glitem{RND>BUF}\verb|( n dest.seg dest.offs len)|\gltail{CODE}{CAM-BUF}
 \begin{descr}
Fill a buffer of the given size, at the given position, with bits that
have a probability of $n/65536$ of being a {\tt 1}. ($n$ is
the expected number of {\tt 1}s for a buffer the size of a
bit plane).  Note that {\tt len} is in bytes.
 \end{descr}

%----------------
\glitem{RND>PL}see {\tt NOT-PL}
\loneskip

%----------------
\glitem{ROW}\verb|( -- 2bits)|\gltail{:}{CAM-HOOD}
 \begin{descr}
Neighbor in the {\tt N/XPAND} neighborhood. Current cell's row position on the 
screen, mod 4.
 \end{descr}

%----------------
\glitem{S.EAST S.WEST}\see{N.EAST}
\loneskip

%----------------
\glitem{S/S-PL}see {\tt NOT-PL}
\loneskip

%----------------
\glitem{SEG=}\verb|( seg1 offs1 seg2 offs2 len -- flag)|\gltail{CODE}{CAM-KEYS}
 \begin{descr}
Compares two strings of length {\tt len}, starting at the given segments and
offsets---returns a {\tt TRUE} flag on the stack if the strings are identical.
 \end{descr}

%----------------
\glitem{SEND-SHIFTS}\verb|( hold.mask)|\gltail{:}{CAM-STEP}
 \begin{descr} 
Overwrites the lookup tables of all \cam{}s with
a ``service'' rule that is used for shifting the bit-planes.  Usually
used within a {\tt BEGIN-SERVICE-STEPS} \ldots {\tt END-SERVICE-STEPS}
pair---which takes care of saving and then restoring the current rule.

A rule that depends on {\tt \&PHASES} is sent to all \cam{}s; depending
on the value of these phases, we get different shift directions (see
{\tt SHIFT}).  Only the regular tables are used for shifting; the
auxiliary tables are given the value that the selected \cam's table had,
to allow {\tt SHOW-FUNCTION} (see) to keep working even during shifts.
(Actually, the auxiliary tables sent by {\tt SEND-SHIFTS} are
constructed from the table saved by {\tt BEGIN-SERVICE-STEPS} (see also
{\tt TSAV-SEG}); if {\tt SEND-SHIFTS} is not being used within the
``{\tt SERVICE-STEPS}'' construct, these auxiliary tables will be
invalid.)

This is a lower-level word than {\tt SHIFTS}.  See the description of the
{\tt hold.mask} under {\tt SHIFTS}; see also {\tt SHIFT}.
 \end{descr}

%----------------
\glitem{SET-CCR}\verb|( mask)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Uses the mask to set all indicated bits of the {\tt CCR} to {\tt 1} (all those
which have {\tt 1}s in corresponding positions in the mask).  From most to
least significant, the {\tt CCR} bits have the names {\tt USETAB}, {\tt
DPYRQ}, {\tt VGLUE}, {\tt HGLUE}, {\tt LDTBL}, {\tt INTENB}, {\tt DPYNRM},
and {\tt CAMOUT}; most of these are documented in this glossary. Only
{\tt VGLUE} and {\tt HGLUE} will be typically controlled 
by explicitly using {\tt
SET-CCR}. See also {\tt C@CAM} and {\tt CLR-CCR}.
 \end{descr}

%----------------
\glitem{SHAD-PTR}\verb|( -- addr)|\gltail{VARIABLE}{CAM-IO}
 \begin{descr}
Pointer to the shadow registers corresponding to the selected \cam.  See
{\tt CAM-SELECT}.
 \end{descr}

%----------------
\glitem{SHAD-SEG}\verb|( -- segment)|\gltail{:}{CAM-IO}
 \begin{descr}
Returns on the stack the value of selected \cam's shadow-memory segment.
This is used to access \cam's shadow variables directly, rather than
via the effects of words such as {\tt N/MOORE, EVEN-GRID, MAKE-CMAP,} etc.
See also {\tt STP0-SEG} and {\tt STP1-SEG}.
 \end{descr}

%----------------
\glitem{SHIFT}\verb|( NSWE.mask)|\gltail{:}{CAM-KEYS}
 \begin{descr}
Assumes that the shift-tables have been downloaded (see {\tt
SEND-SHIFTS}).  Causes a shift of one position in the direction indicated
by the shift mask.  For example, 8 indicates a shift up of all \cam{}s, 4 a
shift down, 2 a shift left, 1 a shift right, 9 a shift up-and-right, etc.
All \cam{}s are shifted simultaneously.
 \end{descr}

%----------------
\glitem{SHIFTS}\verb|( delta-row delta-col hold.mask)|\gltail{:}{CAM-KEYS}
 \begin{descr} Loads the shift tables and performs the indicated shifts
of all bit-planes which aren't held fixed by the {\tt hold.mask}
argument: {\tt 1}s in the mask cause corresponding planes (bit position
0 corresponds to plane 0, etc.) to be held fixed.  Note that {\tt
MOUSE>ORG} produces arguments in the correct format for {\tt SHIFTS}.
 \end{descr}

%----------------
\glitem{SHOW-CAM}\verb|( n)|\gltail{:}{CAM-IO}
 \begin{descr}
Assumes that all \cam\ video-outputs are daisy-chained
and connected to a single monitor.  {\tt SHOW-CAM} will cause the
indicated \cam's internal video signal to be the one passed through the chain to the
monitor.  This word doesn't change the selected \cam\ (see {\tt
CAM-SELECT})---it only controls which output is visible.
 \end{descr}

%----------------
\glitem{SHOW-FUNCTION}\gltail{:}{CAM-HOOD}
 \begin{descr}
Direct the output of the auxiliary tables to be taken as the input to the
color map, in place of the four bits of the center cell.  See also {\tt
SHOW-STATE}.
 \end{descr}

%----------------
\glitem{SHOW-STATE}\gltail{:}{CAM-HOOD}
 \begin{descr}
Cause the four bit cell values to be used directly as the inputs to the
color map---see {\tt SHOW-FUNCTION}.
 \end{descr}

%----------------
\glitem{SIG}\verb%( n -- +1|0|-1)%\gltail{:}{CAM-EDIT}
 \begin{descr}
Returns the sign of the number on the stack---0 gives 0.
 \end{descr}

%----------------
\glitem{SOUTH SOUTH' SOUTHS}\see{NORTH}
\loneskip

%----------------
\glitem{SRQ}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Pointer to the hardware ``step request'' register.  Since step requesting is
normally mediated by the \cam\ interrupt service routine, this register
would only be directly written to in order to test the hardware. See {\tt
C!CAM}, {\tt CAM-BASE}.
 \end{descr}

%----------------
\glitem{SSR}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
This points to the hardware ``step status'' register, which is normally
monitored by the \cam\ interrupt service routine.  It can be read directly
using {\tt C@CAM}, as in {\tt SSR C@CAM}. See also {\tt CAM-BASE}.

The low-order bit is a diagnostic bit, {\tt DIAG}, used to test the \cam\
hardware.  The high-order bit is the ``event detected'' bit, {\tt EVENT}, which
indicates whether or not the intensity output of the color map was {\sl ever} on
during the most recent step (this is used by {\tt EVENT-STOP} and by {\tt
EVENT-COUNT}).  The other bits reflect the dynamic progress of the step as
it runs (Is there a step running? waiting to run? is the display on? are
we within the active portion of the line right now? etc.).
 \end{descr}

%----------------
\glitem{STD-MAP}\gltail{:}{CAM-HOOD}
 \begin{descr}
Standard color map, which assigns the three primary colors to \cama.
This map is useful when we are primarily interested in planes 0 and 1;
planes 2 and 3 are only used for highlighting.
 \end{descr}

%----------------
\glitem{STEP}\gltail{:}{CAM-STEP}
 \begin{descr}
Triggers one \cam\ cell-updating step.  All of the \cam\ parameters should
have been set up before this (such as neighborhood, phases, spatial
origin, color map, etc.---see {\tt N/MOORE} etc., {\tt <PHASE>} etc.).
Execution of the Forth word following {\tt STEP} will not proceed until
shadow variables containing these \cam\ parameters have been copied to
\cam, and the actual step has begun (see {\tt PEND} and {\tt
WAIT-FOR-PEND}, which {\tt STEP} makes use of).

In order to allow steps to run at full speed (every 60-th of a second)
the parameters for the next step must be set up while the current step is
running.  This must be kept in mind when reading event-count
information---see {\tt EVENT-COUNT}. If no instruction to run an active
(updating) step has been sent to \cam\ before the step that is running is
completed, an idle (display-only) step will be scheduled.

Used in conjunction with a run cycle (see {\tt MAKE-CYCLE}), {\tt STEP}
causes a coroutine exit to the main program---the run cycle routine is resumed
by executing {\tt NEXT-STEP}.  If {\tt STEP} is executed in the main
program, no exit occurs.  {\tt IDLE} behaves like {\tt STEP} in all
respects (including the coroutine exit) except that no updating
occurs: all shadow parameters (in particular, color maps and neighborhood
assignments) are transfered and an idle step is begun before execution of
the instruction following {\tt IDLE} occurs.  When multiple \cam{}s are
used together, all \cam{}s respond as a group to a stepping request: they
all either step or idle at the same time.

See also {\tt STEPS}, {\tt STEP-NUMBER}, {\tt EVENT-HANDLER}, {\tt
BEGIN-SERVICE-STEPS}, and {\tt SHIFTS}.
 \end{descr}

%----------------
\glitem{STEP-BASE}\verb|( -- addr)|\gltail{VARIABLE}{CAM-INT}
 \begin{descr}
Contains the base address for the step status and control information
for all \cam{}s (including shadow registers).  It is changed by {\tt
BEGIN-SERVICE-STEPS} to use a distinct set of control information for
service steps. See {\tt STP1-SEG} and {\tt STEP-SEG}.
 \end{descr}

%----------------
\glitem{STEP-COUNT}\verb|( -- offset)|\gltail{EQU}{CAM-INT}
 \begin{descr}
Offset within the {\tt STEP-SEG} of a double-number system variable which is
incremented each time an active step (as opposed to an idle step in which
display but no updating occured) is completed.  This counter is
incremented by the \cam\ interrupt routine.
 \end{descr}

%----------------
\glitem{STEP-NUMBER}\verb|( -- addr)|\gltail{2VARIABLE}{CAM-STEP}
 \begin{descr}
This double-number {\sc variable} is incremented each time the word {\tt STEP} is
executed.  It is used by the \cam\ control-panel program to run a
specified number of steps by starting it with a negative value: when this
number reaches zero, {\tt STEP} turns off the {\tt STEPPING?} flag (see
{\tt STOP}).

When running a reversible rule, this stopping mechanism can be quite
convenient. Start the count at zero, and negate it when you reverse
direction---when you reach zero (the starting configuration) the stepping
will halt.

This variable is maintained by the word {\tt STEP}---it is distinct from
the doubleword {\tt STEP-COUNT} variable within the {\tt STEP-SEG}, which
is incremented by the \cam\ interrupt service routine each time an active
step is started. See also {\tt -STEP\#}.
 \end{descr}

%----------------
\glitem{STEP-PENDING}\verb|( -- offset)|\gltail{EQU}{CAM-INT}
 \begin{descr}
This is the offset into the {\tt STEP-SEG} of a one-byte system variable. 
It is not examined by the interrupt, but it is cleared each time shadow
information is copied to \cam; this lets the foreground routine know that
its safe to change the shadow data.  This flag is used as a semaphore by
{\tt STEP} and {\tt IDLE}, which set this flag and then wait for it to
clear before allowing execution to proceed.
 \end{descr}

%----------------
\glitem{STEP-SEG}\verb|( -- segment)|\gltail{:}{CAM-IO}
 \begin{descr}
Returns on the stack the segment containing global step information
which applies to all \cam{}s (such as the {\tt STEP-PENDING} flag).  See
also {\tt STP0-SEG}, {\tt STEP-TYPE}, {\tt STEP-COUNT},
{\tt EVENT-MASK}, {\tt EVENT-TYPE}, {\tt EVENT-LEN}, and {\tt EVENT-STOP}.
 \end{descr}

%----------------
\glitem{STEP-TYPE}\verb|( -- offset)|\gltail{EQU}{CAM-INT}
 \begin{descr}
This is the offset into the {\tt STEP-SEG} of a one-byte system variable. 
Whenever shadow data is copied to \cam\ by the interrupt service
routine, this byte is copied to the {\tt SRQ} register of the master
\cam.  If the high bit of this register is set, an active (updating) step
is begun; if this bit is a zero, an idle (display) step occurs, with the
new parameters transferred from the shadow registers.  {\tt STEP} and {\tt
IDLE} use this mechanism. See also {\tt STEP-PENDING}.
 \end{descr}

%----------------
\glitem{STEPPING?}\verb|( -- addr)|\gltail{VARIABLE}{CAM-STEP}
 \begin{descr}
This variable is used as a flag by the \cxp\ program to indicate
whether \cam\ is running or stopped.  It can be set or cleared with the
words {\tt GO} or {\tt STOP}.  It is also cleared by the word {\tt STEP}
if the doubleword variable {\tt STEP-NUMBER}, which is incremented by {\tt
STEP}, becomes zero.
 \end{descr}

%----------------
\glitem{STEPRQ}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Step request bit of the step status register---see {\tt SSR}.
 \end{descr}

%----------------
\glitem{STEPS}\verb|( n)|\gltail{:}{CAM-STEP}
 \begin{descr}
Executes the word {\tt STEP} $n$ times.
 \end{descr}

%----------------
\glitem{STOP}\gltail{:}{CAM-KEYS}
 \begin{descr}
Sets a flag (see {\tt STEPPING?}) used by the \cp\ to indicate that \cam\ is not
running.  {\tt STOP} is used by {\tt Stop.running}, which is 
invoked by \keyspace\ from the \cp; any user-defined key can
cause stepping to stop by executing this word. {\tt STOP} can even be used
inside of a run cycle (see {\tt MAKE-CYCLE}) to cause an experiment to
stop itself and wait for the experimenter to restart it.
 \end{descr}

%----------------
\glitem{STORES}\verb|( n dest.seg offs count)|\gltail{CODE}{CAM-BUF}
\glalso{ANDS}
\glalso{ORS}
\glalso{XORS}
 \begin{descr}
{\tt STORES} stores the 16-bit value $n$ in {\tt count} consecutive memory
words. 

{\tt ANDS} {\sc and}'s this value with the contents of those words.  Similarly
for {\tt ORS} and {\tt XORS}.
 \end{descr}

%----------------
\glitem{STP0-SEG}\verb|( -- segment)|\gltail{SEGMENT}{CAM-BUF}
\glalso{STP1-SEG}
 \begin{descr}
This is the area which normally contains the global step information and
shadow variables used during \cam\ stepping (this is the normal value
returned by {\tt STEP-SEG}).  While service steps are being run (see {\tt
BEGIN-SERVICE-STEPS}), the {\tt STP1-SEG} becomes the step segment
instead---all counts accumulated during these steps accumulate there, and
all other changes are made there.  This makes it easy to go back to the
state the machine had before the service steps began.
 \end{descr}

%----------------
\glitem{T*BUF}\gltail{:}{CAM-BUF}
 \begin{descr}
Exchanges the content of the lookup tables and the table-buffer.
 \end{descr}

%----------------
\glitem{T/B-PL}see {\tt NOT-PL}
\loneskip

%----------------
\glitem{TAA}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
\glalso{TBA}
 \begin{descr}
{\tt TAA} is  the offset of the ``\cama\ table-address source select'' register within each \cam's shadow
segment---see {\tt CAM-A}, {\tt N/MOORE} (and other neighborhood words)
and {\tt C!CAM}. Similarly for {\tt TBA} and \camb.
 \end{descr}

%----------------
\glitem{TAB>BUF}\gltail{:}{CAM-BUF}
 \begin{descr}
Saves the lookup tables to their buffer.
 \end{descr}

%----------------
\glitem{TAB>FILE}\gltail{:}{CAM-BUF}
 \begin{descr}
Save entire lookup tables to current table file. Used with {\tt OPEN-TABLE}.
 \end{descr}

%----------------
\glitem{TBA}\see{TAA}
\loneskip

%----------------
\glitem{TBUF-SEG}\verb|( -- segment)|\gltail{SEGMENT}{CAM-BUF}
 \begin{descr}
This is the 4K byte segment used by {\tt TAB>BUF} and {\tt BUF>TAB} to
save and restore the contents of \cam's lookup tables.  See also {\tt
TSAV-SEG}.
 \end{descr}

%----------------
\glitem{TDAT}\verb|( -- offset)|\gltail{EQU}{CAM-IO}
 \begin{descr}
Table data area within \cam\ hardware segment.  Normally accessed using
{\tt MAKE-TABLE}, {\tt TAB>BUF}, and {\tt BUF>TAB}.  Can also be accessed
directly---see {\tt C!CAM}.
 \end{descr}

%----------------
\glitem{TDAT>BUF}\verb|( buf.seg buf.offs first.page #pages)|\gltail{CODE}{CAM-IO}
 \begin{descr}
Low-level primitive for copying table data from \cam\ to the \pc.  The
arguments have the same order and meaning as for {\tt BUF>TDAT} (except of
course that the buffer is a destination this time).  See also {\tt
TAB>BUF}.
 \end{descr}

%----------------
\glitem{TEMP-SEG}\verb|( -- segment)|\gltail{SEGMENT}{CAM-BUF}
 \begin{descr}
Returns the segment address of the 8K temporary buffer.
 \end{descr}

%----------------
\glitem{TEMP>PL}\verb|( n)|\gltail{:}{CAM-BUF}
 \begin{descr}
Copy the contents of the temporary buffer to the active region of plane $n$. See {\tt NOT-PL}.
 \end{descr}

%----------------
\glitem{TICK}\gltail{:}{CAM-LOAD}
 \begin{descr}
Delays the execution by $\approx$55 msec.
 \end{descr}

%----------------
\glitem{TICKS}\verb|( n)|\gltail{:}{CAM-LOAD}
 \begin{descr}
Delays the execution by $\approx n$\by55 msec.
 \end{descr}

%----------------
\glitem{TRACE}\gltail{:}{CAM-HOOD}
 \begin{descr}
{\tt MAKE-TABLE TRACE} will cause the rule for plane 1 to logically
{\sc or} its previous contents with the current contents of plane 0. 
Thus plane 1 will act like an infinite-persistence phosphor: once a bit
has been ``on'' on plane 0, the trace will remain lit until cleared.
 \end{descr}

%----------------
\glitem{TSAV-SEG}\verb|( -- segment)|\gltail{SEGMENT}{CAM-STEP}
 \begin{descr}
This is the segment used by {\tt BEGIN-SERVICE-STEPS} to save the contents
of the tables for up to eight \cam{}s. {\tt END-SERVICE-STEPS} restores the
tables from this buffer.

Since this is a very transient buffer, needed only during service steps
(such as shifts---see {\tt SHIFTS} and {\tt SEND-SHIFTS}), we put this
above all other segments and dynamically allocate and deallocate it
as needed.  4K bytes are allocated for every \cam\ that is present before
the tables are saved, and deallocated whenever they are restored.  Thus
when {\tt EXEC} is executed there is as much memory as possible for
executing commands from {\sc dos}.
 \end{descr}

%----------------
\glitem{UL}\verb|( -- bit)|\gltail{:}{CAM-HOOD}
\glalso{UR}
\glalso{LL}
\glalso{LR}
\glalso{UL'}
\glalso{UR'}
\glalso{LL'}
\glalso{LR'}
\glalso{ULS}\verb|( -- 2bits)|
\glalso{URS}
\glalso{LLS}
\glalso{LRS}

 \begin{descr}
Neighbors made available by the {\tt
N/MARG-HV} major neighborhood assignment. {\tt UL} returns on the stack the value, for the
case under consideration, of the upper-left cell in the Margolus
neighborhood (plane 0 for \cama, 2 for \camb); {\tt UR}, of the upper-right
neighbor; {\tt LL}, of lower-left; and {\tt LR} of lower-right. (Cf.\ {\tt CENTER} and {\tt MAKE-TABLE}).

Similarly for the primed versions---all referring to planes
1 or 3, and the joint versions (e.g., {\tt ULS}={\tt UL}+2\by{\tt UL'}).
 \end{descr}

%----------------
\glitem{USETAB}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
This is the bit in the configuration control register which decides
whether the input to the color map should come from the auxiliary tables
or directly from the bit-planes.  The words {\tt SHOW-FUNCTION} and
{\tt SHOW-STATE} respectively set and clear this bit---see also {\tt
SET-CCR}.
 \end{descr}

%----------------
\glitem{V1}\verb|( -- bit)|\gltail{==}{CAM-HOOD}
 \begin{descr}
Pseudo-neighbor available as part of the {\tt N/XPAND} neighborhood. 
Returns the second-least significant bit of the vertical position of the
center cell.  See also {\tt VERT} and {\tt ROW}.
 \end{descr}

%----------------
\glitem{VAL>PL}see {\tt NOT-PL}
\loneskip

%----------------
\glitem{VERT}\see{HORZ}
\loneskip

%----------------
\glitem{VGLUE}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
This bit in the configuration control register controls whether vertical
gluing of several \cam's into one longer \cam\ (via the vertical-glue
connector) is enabled. See {\tt HGLUE}.
 \end{descr}

%----------------
\glitem{VRUN}\verb|( -- mask)|\gltail{EQU}{CAM-IO}
 \begin{descr}
``Vertical run'' bit of the step status register---see {\tt SSR}.
 \end{descr}

%----------------
\glitem{W/FLY}\verb|( data-buf.seg data-buf.offs n ptr-buf #items len )|\gltail{:}{CAM-IO}
 \begin{descr}
Write on the fly---see {\tt R/FLY}.
 \end{descr}

%----------------
\glitem{WAIT-FOR-IDLE}\gltail{CODE}{CAM-IO}
 \begin{descr}
Wait until \cam\ is inactive---no step in progress and none about to
start.
 \end{descr}

%----------------
\glitem{WAIT-FOR-PEND}\gltail{:}{CAM-IO}
 \begin{descr}
Waits until the {\tt STEP-PENDING} shadow variable is reset to {\tt
FALSE}, indicating that \cam\ has been serviced since {\tt STEP-PENDING}
was set to {\tt TRUE}. See {\tt PEND}.
 \end{descr}

%----------------
\glitem{WEST WEST' WESTS}\see{NORTH}
\loneskip

%----------------
\glitem{WHOLE-AREA}\gltail{:}{CAM-BUF}
 \begin{descr}
Sets the whole screen to be the active region for plane operations---see
{\tt AREA}.
 \end{descr}

%----------------
\glitem{X}\verb|( -- addr)|\gltail{VARIABLE}{CAM-HOOD}
 \begin{descr}
Index variable used during table generation.  Compilation
variables return bits of this index variable, which runs through all
possible cases as it takes on values from 0 to 4095. Cf.\ {\tt Y}.
 \end{descr}

%----------------
\glitem{XOR>PL}\see{AND>PL}
\loneskip

%----------------
\glitem{XORS}\see{STORES}
\loneskip

%----------------
\glitem{Y}\verb|( -- addr)|\gltail{VARIABLE}{CAM-HOOD}
 \begin{descr}
A variable used during table generation as a scratchpad for the
current entry. The low eight bits correspond to the eight lookup-table columns
(four for \cama\ and four for \camb). Cf.\ {tt X}.
 \end{descr}

%----------------
\glitem{\char"5C-PL}\see{NOT-PL}

}%end \glossarysize

\newpage

\section{Notable F83 words}\label{gloss forth}

{\glossarysize

$\null$ \medskip

%----------------
\glitem{!L}\verb|( n segment offset)|\gltail{CODE}{CPU8086}
 \begin{descr}
``Long store:'' store $n$ at {\em segment:offset}. While ordinary Forth addresses
refer to the 64K segment in which the Forth system resides, this can access any location in the \pc\
address space.
 \end{descr}

%----------------
\glitem{'USED name}\gltail{:}{PC}
 \begin{descr} This is a utility function, used for finding all
definitions that make use of the indicated word.  It works by searching
through the Forth dictionary, looking for any pointers to the given
word.  Since the search is crude (it just looks for any 16-bit value in
the dictionary that matches the given word's code-field address), some
extra matches may be returned---but no true matches will be missed.

See also {\tt VOC}.
 \end{descr}

%----------------
\glitem{*BREAK*}\gltail{:}{PC}
 \begin{descr} This acts like an execution vector (see {\tt DEFER}), and
is given control when \keybreak\ is pressed.  The ``break''
always occurs {\sl between} two Forth words (it never interrupts a
machine-language routine).  The action of {\tt *BREAK*} can be modified using
the word {\tt IS}.  For example, {\tt ' TRAP IS *BREAK*} would cause the
word {\tt TRAP} to be executed whenever the \keybreak\ key is invoked
({\tt TRAP} is in fact the normal word executed by {\tt *BREAK*}).  See
also {\tt BREAK-ENABLE} and {\tt BREAK-DISABLE}.
 \end{descr}

%----------------
\glitem{+THRU}\verb|( n0 n1)|\gltail{:}{EXTEND86}
 \begin{descr}
From the current ``from'' file load screens $n+n_0$ through $n+n_1$,
where $n$ is the screen where {\tt +THRU} appears (cf.\ {\tt THRU}).
 \end{descr}

%----------------
\glitem{-->}\gltail{:}{EXTEND86}
 \begin{descr}
Load next screen, skipping the rest of the current one.
 \end{descr}

%----------------
\glitem{...}\gltail{:}{PC}
 \begin{descr}
Used to re-enter the screen editor from Forth where you last left off.  If a new
current-file has been established (see {\tt USING}) this file will be
edited instead.  See also {\tt EDIT}, {\tt M}, and {\tt FIX}.
 \end{descr}

%----------------
\glitem{.NAME}\verb|( nfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Print word name, given its name-field address. See {\tt >NAME}.
 \end{descr}

%----------------
\glitem{2!L}\verb|( d seg offs)|\gltail{:}{PC}
 \begin{descr}
Double-number ``long store'' (see {\tt !L}).
 \end{descr}

%----------------
\glitem{2*}\verb|( n -- 2*n)|\gltail{CODE}{KERNEL86}
 \begin{descr}
Multiplies by 2 by shifting.
 \end{descr}

%----------------
\glitem{2@L}\verb|( seg offs -- d)|\gltail{:}{PC}
 \begin{descr}
Double-number ``long fetch'' (see {\tt @L}).
 \end{descr}

%----------------
\glitem{2\char"5EN}\verb|( n -- 2^n)|\gltail{CODE}{PC}
 \begin{descr}
Given a number from 0 to 15 (decimal) this word returns a 16-bit value
with the $n$-th bit set to one, the other bits set to zero.
 \end{descr}

%----------------
\glitem{4*}\verb|( n -- 4*n)|\gltail{CODE}{KERNEL86}
 \begin{descr}
Multiply by 4 by shifting.
 \end{descr}

%----------------
\glitem{8*}\verb|( n -- 8*n)|\gltail{CODE}{KERNEL86}
 \begin{descr}
Multiplies by 8 by shifting.
 \end{descr}

%----------------
\glitem{::}\gltail{:}{UTILITY}
 \begin{descr}
``On-the-fly'' compiler, used from the interpreter to execute a phrase containing
flow-control directives such as {\tt IF ... THEN} etc., which are not available
in the interpretive mode.  If you type
        \begin{verbatim}
    :: 7F 20 DO I EMIT LOOP ;\end{verbatim}
        the interpreter will compile a nameless word identical to {\tt
PRINT-ASCII} of Section \ref{iteration} and execute it---without taking
any permanent space in the dictionary.
 \end{descr}

%----------------
\glitem{>BODY}\verb|( cfa -- pfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given the code-field address of a word, returns its parameter-field address,
i.e., the address of the first (and possibly the only) data or program cell.
 \end{descr}

%----------------
\glitem{>LINK}\verb|( cfa -- lfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given the code-field address of a word, returns its link-field address (within each
vocabulary, all words form a linked list).
 \end{descr}

%----------------
\glitem{>NAME}\verb|( cfa -- nfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given the code-field address of a word, returns its name-field address.
 \end{descr}

%----------------
\glitem{>VIEW}\verb|( cfa -- vfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given the code-field address of a word, returns its view-field address.
 \end{descr}

%----------------
\glitem{@L}\verb|( segment offset -- n)|\gltail{CODE}{CPU8086}
 \begin{descr}
``Long fetch.''  Fetch $n$ from {\em segment:offset}. While ordinary Forth addresses
refer to the 64K segment in which the Forth system resides, this can access any location in the \pc\
address space.
 \end{descr}

%----------------
\glitem{A-EMIT}\verb|( char)|\gltail{:}{PC}
 \begin{descr}
This is the normal function pointed to by the {\tt DEFER}red word
{\tt EMIT}.  It outputs char to the display screen with the current
attribute (see also {\tt TYPER}).  If the variable {\tt PRINTING?} is
set (see {\tt ON}) the same character is also sent to the standard printer.
 \end{descr}

%----------------
\glitem{ALSO}\gltail{:}{EXTEND86}
 \begin{descr}
Vocabulary search order specifier. See Section \ref{search-order}.
 \end{descr}

%----------------
\glitem{ARRAY name}\verb|( n)|\gltail{:}{PC}
 \begin{descr} Defines, under the given name, a one-dimensional array of
Forth cells, consisting of $n$ entries.  When executed with a number $i$
on the stack, the word {\tt name} will return the address of its $i$-th cell.
 \end{descr}

%----------------
\glitem{AT}\verb|( col row)|\gltail{:}{PC}
 \begin{descr}
Positions the display cursor on the PC at the given row and column.
 \end{descr}

%----------------
\glitem{AUTO-X}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr}
Controls the auto-extend/auto-shrink feature of the Forth screen editor: if non-zero,
this feature is enabled.
 \end{descr}

%----------------
\glitem{BETWEEN}\verb|( n min max -- f)|\gltail{:}{KERNEL86}
 \begin{descr}
Returns a {\tt TRUE} flag if $n$ is in the closed
interval ${\tt min}\leq {\tt n}\leq{\tt max}$.
 \end{descr}

%----------------
\glitem{BLINK}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr}
If this variable is set (see {\tt ON}), subsequently {\tt EMIT}ted characters 
will blink.
 \end{descr}

%----------------
\glitem{BLOCK}\verb|( n -- addr)|\gltail{:}{KERNEL86}
 \begin{descr}
Makes sure that the $n$-th 1024-byte block of data from the current
file is present in a {\sl block buffer} in memory (copying it from disk
if necessary), and returns the address of this buffer.
 \end{descr}

%----------------
\glitem{BODY>}\verb|( pfa -- cfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given parameter-field address of a word, returns its code-field address (cf.\ {\tt >BODY}).
 \end{descr}

%----------------
\glitem{BREAK-DISABLE}\gltail{:}{PC}
 \begin{descr}
Temporarily suppress the action of the \keybreak\ key---see {\tt BREAK-ENABLE} and {\tt
*BREAK*}.
 \end{descr}

%----------------
\glitem{BREAK-ENABLE}\gltail{:}{PC}
 \begin{descr}
Restore the action of the \keybreak\ key. If the key was pressed
while the break function was disabled, its effect will
take place now.  See {\tt BREAK-DISABLE} and {\tt *BREAK*}.
 \end{descr}

%----------------
\glitem{C!L}\verb|( n segment offset)|\gltail{CODE}{CPU8086}
 \begin{descr}
``Long store'' of one byte (cf.\ {\tt !L}).
 \end{descr}

%----------------
\glitem{C@L}\verb|( segment offset -- n)|\gltail{CODE}{CPU8086}
 \begin{descr}
``Long fetch'' of one byte (cf.\ {\tt !@}).
 \end{descr}

%----------------
\glitem{CAPACITY}\verb|( -- n)|\gltail{:}{KERNEL86}
 \begin{descr}
Returns the size (in 1024-byte blocks) of the current file.
 \end{descr}

%----------------
\glitem{CAPS}\verb|( -- addr)|\gltail{VARIABLE}{KERNEL86}
 \begin{descr}
When this {\sc variable} is set, characters
read by the interpreter are converted to upper case.
 \end{descr}

%----------------
\glitem{CARRAY}\verb|( len)|\gltail{:}{PC}
 \begin{descr}
Like {\tt ARRAY}, but the array elements are bytes, to be accessed by {\tt C@}
and {\tt C!}.
 \end{descr}

%----------------
\glitem{CENTRONICS}\gltail{:}{UTILITY}
 \begin{descr}
Similar to {\tt EPSON}, for a Centronics-like printer.
 \end{descr}

%----------------
\glitem{COM}\gltail{CREATE}{PC}
 \begin{descr}
Exits to the DOS command interpreter.  Upon return, continues with the
following instruction, with the stack unchanged.  If you return to Forth
with the directory changed, Forth will complain when you try to continue
editing files in the old directory.  Defined using {\tt >DOS} (which in
turn calls {\tt EXEC}) as follows:
        \begin{verbatim}
    CREATE COM  ," "  >DOS\end{verbatim}
        To see how to define Forth words which invoke DOS commands, see
{\tt >DOS}. Used by {\tt DOS...} in previous section.
 \end{descr}

%----------------
\glitem{CONVEY}\verb|( first last)|\gltail{:}{UTILITY}
 \begin{descr}
Copy a consecutive range of screens (see Section \ref{moving screens}).   A
second version of this word exists in the {\tt SHADOW} vocabulary for
moving screens along with their documentation `shadows.'  The arguments
are the same as above---you give the command as if you were just moving
the code screens.
 \end{descr}

%----------------
\glitem{COPY}\verb|( from to)|\gltail{:}{UTILITY}
 \begin{descr}
Copy the contents of a screen to another screen, updating the disk to
reflect the change.
 \end{descr}

%----------------
\glitem{CREATE-FILE filename}\verb|( #blocks)|\gltail{:}{EXTEND86}
 \begin{descr}
Create a file of given size (in blocks) and given name. If the file already exists,
the old version will be deleted.
 \end{descr}

%----------------
\glitem{DARK}\gltail{:}{PC}
 \begin{descr}
Clear the \pc\ screen (to the default attribute).
 \end{descr}

%----------------
\glitem{DEBUG name}\gltail{:}{UTILITY}
 \begin{descr}
Setup to trace the execution of the given word.  Tracing will subsequently
occur whenever the given word is executed.  After each instruction 
comprising the word is executed, the name of the instruction and the
contents of the stack at that point will be displayed; hit {\sc space}
to continue with the execution. 

Tracing can be turned off by executing {\tt UNBUG}, or by pressing
\keybreak.  Tracing can be temporarily suspended by pressing the {\tt F} key, which
puts you in Forth and lets you examine variables.  Resume tracing using
{\tt RESUME}.
 \end{descr}

%----------------
\glitem{DEFER name}\gltail{:}{KERNEL86}
 \begin{descr}
Defining word used to construct a vectored-execution word.  The vector
is set using the word {\tt IS}, and can be examined using the
word {\tt SEE}.  For example, {\tt DEFER EMIT} defines the word {\tt EMIT}
to be such a deferred word, and
        \begin{verbatim}
    ' A-EMIT IS EMIT\end{verbatim}
        vectors {\tt EMIT} to execute {\tt A-EMIT}.
 \end{descr}

%----------------
\glitem{DIR filespec}\gltail{:}{EXTEND86}
 \begin{descr}
List all files in the current directory matching the given file specification
(example: {\tt DIR *.PAT}) .
If no specification is given, the whole directory is listed. See also {\tt USING}.
 \end{descr}

%----------------
\glitem{DISCARD}\gltail{:}{KERNEL86}
 \begin{descr}
The opposite of {\tt UPDATE}: marks a block buffer as
reusable at any time without saving its contents to disk.
 \end{descr}

%----------------
\glitem{>DOS}\gltail{:}{PC}
 \begin{descr}
Used to define Forth words which execute commands at the DOS level.   For
example,
        \begin{verbatim}
    CREATE BACKUP  ," /c copy c:*.exp a:"  >DOS\end{verbatim}
        would create a Forth word {\tt BACKUP} which, when executed,
would copy all experiment files from drive C: to drive A: to produce a
backup.  Any executable file can be invoked in a similar manner.  {\tt
>DOS} is a defining word which causes the most recently defined word to
invoke {\tt EXEC} on its parameters when it is executed.  {\tt COM} is
defined using {\tt >DOS}. See also {\tt DOS...} in the \cam\ section of the
glossary.
 \end{descr}

%----------------
\glitem{DRIVE drivespec}\verb|( -- n)|\gltail{:}{EXTEND86}
 \begin{descr}
Converts a drive specification into a number.  For example, {\tt DRIVE B:}
leaves the number 2 on the stack.  See {\tt IS-HOME-OF}.
 \end{descr}

%----------------
\glitem{DUMP}\verb|( addr len)|\gltail{:}{UTILITY}
 \begin{descr}
Produces a formatted dump of the specified number of memory bytes
starting from the given address. See {\tt LDUMP}.
 \end{descr}

%----------------
\glitem{EDIT}\verb|( n)|\gltail{:}{PC}
 \begin{descr}
Begin editing screen $n$ of the current file.  Note that if editing
is initiated from Forth, when you leave the editor (by pressing \keyesc) you
return to Forth.
 \end{descr}

%----------------
\glitem{END}\gltail{DEFER}{KERNEL86}
 \begin{descr}
This {\tt DEFER}red word is executed by {\tt BYE} before exiting to DOS.
It normally points to a routine which restores the various interrupt
vectors that the Forth system program used, and performs other similar clean-up activities.
 \end{descr}

%----------------
\glitem{EPSON}\gltail{:}{UTILITY}
 \begin{descr} Send the character codes necessary to set up an
Epson-like printer (such as the standard-issue \pc\ printer) for
compressed printing mode.  Used by {\tt SHOW} and {\tt LISTING} in order to produce
compact listings. See also {\tt CENTRONICS} and {\tt INIT-PR}.
 \end{descr}

%----------------
\glitem{EXPECTR}\verb|( addr len)|\gltail{DEFER}{PC}
 \begin{descr}
Same as Forth's standard {\tt EXPECT}, but complements the reverse-video attribute while it
is active, to highlight the input.  See {\tt REVERSE}.
 \end{descr}

%----------------
\glitem{FIX name}\gltail{:}{PC}
 \begin{descr}
Find the source for the given word, and enter the editor at the
appropriate point to edit it.  If the word is a system word (part of {\tt F83}
or of {\tt CAM}), the appropriate sources must be on-line and on the
expected drive (see {\tt IS-HOME-OF}).  If the sources aren't online,
{\tt FIX} will at least tell you what file and screen the sources were in.
If the word is one that you have defined yourself, then it will be found
only if it is in the current file (but cf.\ Section \ref{editing}) .  See also {\tt VIEW}, {\tt EDIT}, and
{\tt M}.
 \end{descr}

%----------------
\glitem{FLIP}\verb|( n -- n')|\gltail{CODE}{KERNEL86}
 \begin{descr}
Swap high and low byte in given 16-bit quantity.
 \end{descr}

%----------------
\glitem{FORGET name}\gltail{CODE}{KERNEL86}
 \begin{descr}
Look up the given word in the current vocabulary, and forget all 
entries that were made in the dictionary since that word was defined
(including {\tt name} itself)
 \end{descr}

%----------------
\glitem{FORM-FEED}\gltail{:}{UTILITY}
 \begin{descr}
Send CR and FF codes for printer form feed.
 \end{descr}

%----------------
\glitem{FORTH-SEG}\verb|( -- seg)|\gltail{CODE}{KERNEL86}
 \begin{descr}
Returns the address (in 16-byte ``paragraphs'') of the segment containing 
the Forth system proper. This is useful for example in intersegment
moves.  See also {\tt LMOVE}, {\tt @L}, etc.
 \end{descr}

%----------------
\glitem{FROM filename}\gltail{:}{EXTEND86}
 \begin{descr}
Used for loading one file from within another (see also {\tt
INCLUDE}) and for copying screens from one file to another, in association
with {\tt CONVEY}.  Opens the named file as the current input (or ``from'') file.
 \end{descr}

%----------------
\glitem{G}\gltail{CODE}{PC}
 \begin{descr}
Used when Forth is running under the {\tt DEBUG.COM} program, to transfer
control to debug by issuing an interrupt 3.  If interrupt 3 is not being
trapped, {\tt G} does nothing.
 \end{descr}

%----------------
\glitem{I'M name}\gltail{:}{PC}
 \begin{descr}
This is used to set the 3-character identifier that appears in the upper
right corner of screens modified from the editor.  Only screens which have
a comment line at the top (one starting with a backslash) are marked.
 \end{descr}

%----------------
\glitem{I/NORM}\gltail{:}{PC}
 \begin{descr}
Restore {\tt KEY} and {\tt KEY?} to their default values, in case these
{\tt DEFER}red words have been redefined in order to redirect input.
 \end{descr}

%----------------
\glitem{INIT-PR}\gltail{DEFER}{UTILITY}
 \begin{descr}
{\tt DEFER}red word, executed to put printer in compressed-text mode.
See {\tt EPSON} and {\tt CENTRONICS}.
 \end{descr}

%----------------
\glitem{INS0}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr} 
Variable which controls whether the insert mode is
on (non-zero value) or off each time you enter the editor. 
 \end{descr}

%----------------
\glitem{INS-SCR}\verb|( n)|\gltail{:}{PC}
 \begin{descr} Insert $n$ blank screens in the current file, immediately
before the screen last accessed by the editor.
 \end{descr}

%----------------
\glitem{INTENSITY}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr}
This variable controls whether or not subsequently {\tt EMIT}ted characters 
will be intensified---see {\tt BLINK}.
 \end{descr}

%----------------
\glitem{IS name}\verb|( n)|\gltail{:}{KERNEL86}
 \begin{descr}
The value on the stack is stored in the data cell associated with the
word whose name follows. If this is a {\sc variable}, {\sc constant}, or
{\sc defer}red word, the data cell is simply the word's parameter field.
Typically, {\tt IS} is used for changing the value of a {\sc constant}
or a pseudo-variable, or for changing the routine pointed to by
a {\sc defer}red word.
 \end{descr}

%----------------
\glitem{IS-HOME-OF}\verb|( n)|\gltail{:}{EXTEND86}
 \begin{descr}
Used to reset the drive specification used by {\tt FIX} and {\tt VIEW} to
find a source file.  For example,
        \begin{verbatim}
    DRIVE B: IS-HOME-OF KERNEL86.4TH\end{verbatim}
        can be used to tell these words that this file is now to be
found on drive {\tt B:}---rather than whatever drive the file was on
when the system was last compiled (usually {\tt C:}).
 \end{descr}

%----------------
\glitem{KNAME}\verb%( pckey -- str|0)%\gltail{:}{PC}
 \begin{descr}
Used to convert a key code returned by {\tt PCKEY} (which is the default
{\tt KEY} routine) into a pointer to a counted string that names the key. 
If no name has been assigned to this key, 0 is returned.
 \end{descr}

%----------------
\glitem{L}\gltail{:}{UTILITY}
\glalso{N}
\glalso{P}
\glalso{T}
\glalso{M}
 \begin{descr}
{\tt L} lists the most recently {\tt VIEW}ed screen again, {\tt N} the
next,  {\tt P} the previous; {\tt T} toggles the shadow twin; and {\tt M} 
calls the editor for modifying the current view-screen.
See {\tt VIEW}.
 \end{descr}

%----------------
\glitem{L>NAME}\verb|( lfa -- nfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given the link-field address of a word, returns its name-field address (cf.\ {\tt >LINK}).
 \end{descr}

%----------------
\glitem{LDUMP}\verb|( seg offs len)|\gltail{:}{UTILITY}
 \begin{descr}
Like {\tt DUMP}, but with a ``long'' address consisting of segment:offset.
 \end{descr}

%----------------
\glitem{LINK>}\verb|( lfa -- cfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given the link-field address of a word, returns its code-field address (cf.\ {\tt >LINK}).
 \end{descr}

%----------------
\glitem{LISTING}\gltail{:}{UTILITY}
 \begin{descr} Used to produce a complete listing of the current file,
assumed to have shadow screens.  For other files, see {\tt SHOW}.
 \end{descr}

%----------------
\glitem{LMOVE}\verb|( src.seg offs dest.seg offs #byts)|\gltail{CODE}{PC}
 \begin{descr}
Intersegment move of data from source-segment:offset to destination.
 \end{descr}

%----------------
\glitem{LOWR}\gltail{:}{PC}
 \begin{descr}
Put the \pc\ in lower-case shift state.
 \end{descr}

%----------------
\glitem{M}\see{L}
\loneskip

%----------------
\glitem{MANY}\gltail{:}{UTILITY}
 \begin{descr}
If you type a single line of the form
        \begin{verbatim}
    phrase MANY\end{verbatim}
        the given phrase will be interpreted over and over. Hitting any
key aborts the loop.
 \end{descr}

%----------------
\glitem{MARK name}\gltail{:}{EXTEND86}
 \begin{descr}
Define a word which, when called, will {\tt FORGET} everything up to but
not including the word itself. If you are debugging an application and
expect to have to load its source file over and over before it reaches its final form,
it's inconvenient to have to {\tt FORGET} by hand the latest version every time
you load a new one. Enter \id|FOOLING| as the first line of your file,
type \id|MARK FOOLING| at the keyboard to put your place marker in the
dictionary, and every time you load the file the dictionary will be cleaned up to
there as the first thing.

The \cam\ words {\tt NEWX} and {\tt NEW-EXPERIMENT} make use of this
mechanism to clear out old definitions.
 \end{descr}

%----------------
\glitem{N}\see{L}
\loneskip

%----------------
\glitem{N>LINK}\verb|( nfa -- lfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given the name-field address of a word, returns its link-field address (cf.\ {\tt >LINK}).
 \end{descr}

%----------------
\glitem{NAME>}\verb|( nfa -- cfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given a name-field address, return the corresponding code-field address.
 \end{descr}

%----------------
\glitem{NNUM}\gltail{:}{PC}
 \begin{descr}
Set the \pc\ to no-{\sc NumLock} mode.
 \end{descr}

%----------------
\glitem{NORMAL}\gltail{DEFER}{PC}
 \begin{descr}
Reset display attributes and keyboard shift states to a default value.
 \end{descr}

%----------------
\glitem{NUMBER}\verb|( str -- d)|\gltail{DEFER}{KERNEL86}
 \begin{descr}
Attempts to convert the given string to a
number, always returned in double-number form.
 \end{descr}

%----------------
\glitem{NUML}\gltail{:}{PC}
 \begin{descr}
Put the \pc\ into {\sc NumLock} mode.
 \end{descr}

%----------------
\glitem{O/NORM}\gltail{:}{PC}
 \begin{descr}
Reset {\tt EMIT} to point to {\tt A-EMIT}, the normal output routine.
 \end{descr}

%----------------
\glitem{OFF}\verb|( addr)|\gltail{:}{EXTEND86}
\glalso{ON}
 \begin{descr}
{\tt ON} sets the data cell at {\tt addr} to {\tt TRUE} (={\tt FFFF});
{\tt OFF} sets it to {\tt FALSE} (={\tt 0000});
 \end{descr}

%----------------
\glitem{ONLY}\gltail{:}{EXTEND86}
 \begin{descr}
Vocabulary search order specifier. See Section \ref{search-order}.
 \end{descr}

%----------------
\glitem{P}\see{L}
\loneskip

%----------------
\glitem{PAGE}\gltail{:}{UTILITY}
 \begin{descr}
Set up the printer to go to a new page, and appropriately increment or reset
the internal page, line, and character counters.
 \end{descr}

%----------------
\glitem{PCKEY}\verb|( -- char.code)|\gltail{:}{PC}
 \begin{descr}
The normal input routine, pointed to by {\tt KEY}.  All normal ASCII
characters are returned unchanged; special \pc\ characters are returned as
negative numbers (the negative of the non-zero part of their two-byte
codes).  Thus all non-printing characters are numerically less than the
{\sc space} character.  See also {\tt KNAME} and {\tt PEEK}.
 \end{descr}

%----------------
\glitem{PEEK}\verb|( -- val)|\gltail{:}{PC}
 \begin{descr}
This acts the same as {\tt PCKEY}, but doesn't remove the character from
the input buffer. If no character is waiting in the input buffer, returns a 0.
 \end{descr}

%----------------
\glitem{PREVIOUS}\gltail{:}{EXTEND86}
 \begin{descr}
Vocabulary search order specifier. See Section \ref{search-order}.
 \end{descr}

%----------------
\glitem{RECURSE}\gltail{:}{KERNEL86}
 \begin{descr}
Within a {\sc colon}-compiled word, this is a recursive call to the word itself.
See {\tt RECURSIVE}.
 \end{descr}

%----------------
\glitem{RECURSIVE}\gltail{:}{KERNEL86}
 \begin{descr} Used within the definition of a {\sc colon}-compiled
word, say {\tt MY-WORD}, to let any subsequent occurrences of {\tt
MY-WORD} in the definition refer to the very word under compilation
rather than a previous word of the same name (if any) already in the
dictionary (cf.\ Section \ref{dictionary}, and footnote
\ref{foot.recursive} of Chapter \ref{asm}). See {\tt RECURSE}.
 \end{descr}

%----------------
\glitem{RESUME}\gltail{:}{UTILITY}
 \begin{descr}
Can be used to continue a Forth trace (see {\tt DEBUG}) after temporarily
suspending it to re-enter Forth to examine variables, etc.
 \end{descr}

%----------------
\glitem{REVERSE}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr}
When {\tt REVERSE} is set, subsequent characters {\tt EMIT}ted are in
reverse-video.  See {\tt BLINK}.
 \end{descr}

%----------------
\glitem{ROOT}\gltail{VOCABULARY}{EXTEND86}
 \begin{descr}
This is the {\sl root} vocabulary, included in every search order
(but cf.\ {\tt SEAL}). See Section \ref{search-order}.
 \end{descr}

%----------------
\glitem{S-KEYS}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr}
When this variable is {\tt TRUE} (={\tt FFFF}), all shift keys behave normally.  When this
variable is set to {\tt F} (hex) the action of all shift-lock keys ({\sc CapsLock},
{\sc ScrollLock}, {\sc NumLock}, and {\sc Ins}) is suppressed.
 \end{descr}

%----------------
\glitem{SAVE-SYSTEM filename}\gltail{:}{EXTEND86}
 \begin{descr}
Save ``as is'' to a file an executable version of the currently running Forth (or \cam\ Forth) system,
with its entire dictionary up to {\tt HERE}; the values of variables
and other changeable data cells in the dictionary are saved as well. Data
outside the dictionary (such as disk-block buffers) are not saved.
Useful for saving minor changes, default settings, etc.\ without having
to recompile the system. F83 takes approximately 31K bytes; \cam\ Forth
approximately 58K.

Typical usage:
        \begin{verbatim}
    SAVE-SYSTEM CAM.EXE\end{verbatim}
 \end{descr}

%----------------
\glitem{SCAN}\verb|( addr len char -- addr' len')|\gltail{CODE}{KERNEL86}
 \begin{descr} In a buffer at position {\tt addr}, for a length {\tt
len}, scan for the first occurrence of {\tt char}, returning the
position where it was found, and how many characters remain in the buffer
from that position on.
 \end{descr}

%----------------
\glitem{SEAL}\gltail{:}{EXTEND86}
 \begin{descr} Vocabulary search order specifier (cf.\ Section
\ref{search-order}).  It removes the {\tt ROOT} vocabulary from the
search order, thus preventing further manipulation of the search order.
Used for protected or turn-key applications.
 \end{descr}

%----------------
\glitem{SEE name}\gltail{:}{UTILITY}
 \begin{descr}
Decompile the indicated word.  This restricted ability to look at word
definitions is available without reference to source code.  See also {\tt
VIEW} and {\tt VOC}.
 \end{descr}

%----------------
\glitem{SEGMENT name}\verb|( n)|\gltail{:}{PC}
 \begin{descr} 
Used to reserve space in the PC's memory outside of the
segment in which the \cam\ Forth code resides, for data buffers.  Makes
the word that follows a Forth constant that returns the segment of an
allocated space of $n$ contiguous bytes.  {\tt SEGMENT}
calls DOS function {\tt 4A} (hex) to inform DOS of the new allocation.  For
instance, {\tt 500 SEGMENT EX-SEG}\ reserves 500 bytes and sets {\tt
EX-SEG} to the memory segment value so that the first byte of the
reserved area is at location {\tt EX-SEG:0000}. If $n$=0, a 64K
segment is allocated.
 \end{descr}

%----------------
\glitem{SEG-TOT}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr}
This variable contains the total amount of memory space (in 16-byte
paragraphs) used by the Forth system, including the segment
where the system itself resides.  It is incremented by {\tt SEGMENT}.
 \end{descr}

%----------------
\glitem{SET-BASE}\gltail{DEFER}{PC}
 \begin{descr}
{\tt DEFER}red word which is used to set the default base.  Usually points
to either {\tt DECIMAL} or {\tt HEX}.
 \end{descr}

%----------------
\glitem{SET-MEM}\verb|( #paragraphs)|\gltail{:}{PC}
 \begin{descr}
Inform DOS of the current memory allocation that Forth is using.  See {\tt
SEGMENT}.
 \end{descr}

%----------------
\glitem{SHADOW}\gltail{VOCABULARY}{UTILITY}
 \begin{descr}
Vocabulary used in conjunction with documentation screens (``shadow''
screens).  {\tt CONVEY} has a shadow-version which copies both code and
shadows simultaneously, when given the parameters for copying the code
alone.  {\tt SHOW} also has a shadow version, which is used in {\tt
LISTING}.
 \end{descr}

%----------------
\glitem{SHOW}\verb|( first last)|\gltail{:}{UTILITY}
 \begin{descr}
Listing utility---see Section \ref{listing}.
 \end{descr}

%----------------
\glitem{SKIP}\verb|( addr len char -- addr' len')|\gltail{CODE}{KERNEL86}
 \begin{descr}
Scan until the first character that doesn't match {\tt char}
(cf.\ {\tt SCAN}).
 \end{descr}

%----------------
\glitem{SLOW-KEY}\gltail{:}{PC}
 \begin{descr}
Used with \cam\ key definitions that are slow to execute---this clears the
keyboard buffer so that repeats of the slow key aren't inadvertently
accumulated.
 \end{descr}

%----------------
\glitem{T}\see{\tt L}
\loneskip

%----------------
\glitem{THRU}\verb|( n0 n1)|\gltail{:}{EXTEND86}
 \begin{descr}
From the current input (or ``from'') file, load screens $n_0$ through $n_1$.
 \end{descr}

%----------------
\glitem{TIMES}\verb|( n)|\gltail{:}{UTILITY}
 \begin{descr}
If you type a single line of the form
        \begin{verbatim}
    phrase 7 TIMES\end{verbatim}
        the given phrase will be interpreted seven times (cf.\ {\tt MANY}).
 \end{descr}

%----------------
\glitem{TO 1st.dest}\verb|( 1st.source last.source -- 1st.source last.source)|\gltail{:}{UTILITY}
 \begin{descr}
Used with {\tt CONVEY}.
 \end{descr}

%----------------
\glitem{TRAP}\gltail{DEFER}{KERNEL86}
 \begin{descr}
Executed as part of the processing whenever an error or a keyboard \keybreak\
occurs.  This is a {\tt DEFER}red word.
 \end{descr}

%----------------
\glitem{TYPER}\verb|( addr len)|\gltail{:}{PC}
 \begin{descr}
{\tt EMIT}'s a string with the {\tt REVERSE} attribute inverted---used for
highlighting.
 \end{descr}

%----------------
\glitem{UEXT}\verb|( -- addr)|\gltail{CREATE}{PC}
 \begin{descr}
Points to the default filename and extension used by {\tt USING}.
 \end{descr}

%----------------
\glitem{UM/MOD}\verb|( d n -- remainder quotient)|\gltail{CODE}{KERNEL86}
 \begin{descr}
Forth's unsigned-division primitive---a double number is divided by a single number to
produce single remainder and quotient.
 \end{descr}

%----------------
\glitem{UNDERLINE}\verb|( -- addr)|\gltail{VARIABLE}{PC}
 \begin{descr}
When this {\sc variable} is set, subsequently {\tt EMIT}ted characters  will have their {\sl
underline} attribute set.
 \end{descr}

%----------------
\glitem{UPDATE}\gltail{:}{KERNEL86}
 \begin{descr}
Marks the current block buffer (see {\tt BLOCK}) as updated, so that it will be saved
to disk.
 \end{descr}

%----------------
\glitem{UPPR}\gltail{:}{PC}
 \begin{descr}
Put the \pc\ in {\sc Caps-Lock} mode.
 \end{descr}

%----------------
\glitem{USING filename}\gltail{:}{PC}
 \begin{descr}
This word is to be used to activate a file for read/write operations and
editing directly from Forth.  The related F83 word {\tt OPEN} should be
avoided, since it interacts badly with {\tt FORGET} and {\tt
NEW-EXPERIMENT}.

The default extension in F83 is {\tt 4TH}, but in the {\tt CAM} program
{\tt EXP} becomes the default.  If no filename is specified, or if the
name contains any wildcard characters, a selctive directory listing is
given.  If the file doesn't exist, {\tt USING} will offer to create it.
For example, {\tt USING RHINO} opens the file {\tt RHINO.EXP} for
read/write.  If an extension is given, it is of course used. See also {\tt UEXT}.
 \end{descr}

%----------------
\glitem{V-EMIT}\verb|( repetitions char)|\gltail{:}{PC}
 \begin{descr}
Calls the ROM BIOS video-I/O routine to emit a number of repetitions of a given
character, with the current attribute (see {\tt BLINK}, {\tt A-EMIT},
etc).  Output is very fast, and leaves the cursor back where it started.
 \end{descr}

%----------------
\glitem{VIEW name}\gltail{:}{UTILITY}
 \begin{descr}
This is used for locating and examining source code (see also {\tt FIX}).
{\tt VIEW} simply lists the screen containing the definition, and makes
this file and screen respectively the current {\sl view} file and the current screen.  Only
the words {\tt L}, {\tt N}, {\tt P}, {\tt T}, and {\tt M} make reference
to this view-file; the current file used for editing and loading is
unaffected by {\tt VIEW}.
 \end{descr}

%----------------
\glitem{VIEW>}\verb|( vfa -- cfa)|\gltail{:}{KERNEL86}
 \begin{descr}
Given a view-field address, return the corresponding code-field address.
 \end{descr}

%----------------
\glitem{VOC name}\gltail{:}{PC}
 \begin{descr}
Searches all vocabularies for the given word; the name of each vocabulary
that contains a matching entry is printed.  If no vocabulary name is
printed, the word is undefined.
 \end{descr}

%----------------
\glitem{Y/N}\verb|( -- f)|\gltail{:}{PC}
 \begin{descr}
Prints the message ``(Y/N)'' and waits for a key to be pressed.  If `y' or
`Y' is pressed, returns true, else false.
 \end{descr}

%----------------
\glitem{\char"7B}\verb|( n)|\gltail{:}{UTILITY}
 \begin{descr} Begins a {\sc case} statement---a sort of computed
subroutine call.  The $n$-th Forth word in the list between the
curly braces is executed ($n$ is the number on the stack), and then
execution continues with the word immediately following the list.  An
error is given if the argument is out of range.  For example,
        \begin{verbatim}
                                          : -ATTR ( n)
    { REVERSE UNDERLINE BLINK INTENSITY }
                      DUP @ NEGATE SWAP ! ;\end{verbatim}
        This word would invert the value of one of four display attributes---the number
on the stack tells which one.

All items within the curly braces must be defined Forth words.
Note that numbers are not single Forth words, except for those that are
defined as {\sc constant}'s; for convenience, the first sixteen hexadecimal
digits are defined as constants (\id|0| through \id|F|).  Like other
words involving branching, this construct can only appear within a
compiled word.
 \end{descr}

%----------------
\glitem{\char"7D}\gltail{:}{UTILITY}
 \begin{descr}
See {\tt \char"7B}.
 \end{descr}

}%end \glossarysize

