the <emphasis>value</emphasis> of the variable whose name appears on
the left. This is referred to as substitution.</para>
+<indexterm><primary>Substitution</primary></indexterm>
+
<para>For our specific example, then, the evaluation of the iterative
formula could be described as</para>
to be represented here occasionally (but not punched on input cards),
as the character "□". Thus the following are alphabetic
constants: $ABCD$, $TO BE$, $DEC. 4$, $5 +3=8$. Note that blank
-spaces<indexterm><primary>Blank Spaces</primary></indexterm>, while
+spaces<indexterm><primary>Blank Spaces</primary></indexterm>
+<indexterm><primary>Spaces, Blank</primary></indexterm>, while
ignored elsewhere in the language, count as characters in alphabetic
constants. An alphabetic constant is stored internally as an integer,
and any constant containing fewer than six characters will be extended
array consists of the variable name, (i.e one to six letters or
digits, starting with a letter), followed by the appropriate
subscripts separated by commas and enclosed in parentheses. Thus the
-following are "single variables:": X51, ALPHA6, LAMBDA, GROSS, while
-the following are elements of arrays: BETA(C1, C2, 6), X15(Y, Z1),
+following are "single variables:": X51, ALPHA6, LAMBDA, GROSS,
+<indexterm><primary>Single Variables</primary></indexterm>
+while the following are elements of arrays: BETA(C1, C2, 6), X15(Y, Z1),
J(6), J(Z1 + 5 *Z2, 5). (See <xref linkend='subscripts'/> for the
description of subscripts.)
Parentheses<indexterm><primary>Parentheses</primary></indexterm>
<sect2 id='statement_labels'><title>Statement Labels</title>
+<indexterm><primary>Statement Labels</primary></indexterm>
+
<para>A statement may be labelled or unlabelled. Labels are used to
refer to a statement in other statements. A statement label consists
of from one to six letters or digits, the first of which must be a
letter, e.g. IN or BACK. A statement label may be an element of a
-statement label vector, in which case the vector name is followed by a
-<emphasis>constant</emphasis> integer subscript enclosed in
+statement label vector,<indexterm><primary>Statement Label
+Vector</primary></indexterm> in which case the vector name is followed
+by a <emphasis>constant</emphasis> integer subscript enclosed in
parentheses, e.g. S(2) or LBL(3). A statement label appears in the
label field (i.e. columns 1-10) of the statement it identifies. When
a statement extends to additional cards (i.e. cards identified by a
<indexterm><primary>Addition</primary></indexterm></para></listitem>
<listitem><para>Subtraction, written as "-", e.g., Z5 - D. (Note,
-both the minus sign and the dash are accepted.)</para></listitem>
+both the minus sign and the dash are accepted.)
+<indexterm><primary>Subtraction</primary></indexterm>
+</para></listitem>
<listitem><para>Multiplication, written as "*", e.g. Z5*D. (Note that the
"*" may not be omitted. It is illegal to write Z5D, since it
<para>Examples:</para>
<indexterm><primary>Expression, Compound</primary></indexterm>
+<indexterm><primary>Subexpression</primary></indexterm>
<orderedlist>
<listitem><para>A + B - C + D - E means (((A + B) - C) + D) - E.</para></listitem>
<para>The kind of arithmetic performed on a constant, variable or
function value is determined by its mode. There are five modes in
-MAD; floating point, integer, Boolean, statement label, and function
-name.<indexterm><primary>Function Name</primary></indexterm> Floating
-point, integer, and Boolean constants were described in <xref
+MAD; floating point, integer, Boolean, statement
+label,<indexterm><primary>Statement Labels</primary></indexterm> and
+function name.<indexterm><primary>Function Name</primary></indexterm>
+Floating point, integer, and Boolean constants were described in <xref
linkend='constants'/>. Alphabetic constants are assumed to be of
integer mode. <xref linkend='mode_declaration'/> describes how the
modes of variables and functions are specified.</para>
arithmetic expression is considered to be in the floating point mode
if any operand of any arithmetic expression in the expression is in
the floating point mode. If all operands are integer (or alphabetic),
-then the expression is conisdered to be in the integer mode. In this
+then the expression is considered to be in the integer mode. In this
determination arguments, though not values, of functions are
ignored.<indexterm><primary>Compound Expression</primary></indexterm></para>
originally stated just to achieve the "truncation" effect.</para>
<para>A statement label (appearing in the label field of a statement)
-is a constant of statement label mode. A function
+is a constant of statement label mode.<indexterm><primary>Statement
+Labels</primary></indexterm> A function
name<indexterm><primary>Function Name</primary></indexterm> with no
arguments (e.g. SIN.) is a constant of a function name mode. A single
constant, variable, or function value of statement label (function
<sect2 id='subscripts'><title>Subscript Expressions</title>
+<indexterm><primary>Subscripts</primary></indexterm>
+
<para><emphasis>Any</emphasis> arithmetic expression may be used as a
subscript expression for an element of a linear array. If the value
of the expression is in the floating point mode (see
<sect2 id='substitution'><title>Substitution Statement</title>
+<indexterm><primary>Substitution Statement</primary></indexterm>
+
<!-- beginpage II.10 -->
<para>This statement has the form illustrated by</para>
</programlisting>
<para>(iv) A table-look-up procedure using an interation statement.
+<indexterm><primary>Table Lookup</primary></indexterm>
Suppose that a string of alphabetic (or numeric) characters (i.e., a
"sentence") has been decomposed into single characters stored in C(1),
C(2), ..., C(K), where K is the length of the string. Then the first
program is imbedded) is automatically entered. This action can be
changed by executing the statement EXECUTE SETEOF. (&scriptS;). The
subroutine SETEOF.
-<indexterm><primary>SETEOF Subroutine</primary></indexterm>
+<indexterm><primary>SETEOF Subroutine</primary></indexterm>
+<indexterm><primary>SYSTEM Subroutine</primary></indexterm>
+
<!-- beginpage II.25 -->
sets the read routines to transfer to the executable statement
labelled &scriptS; when an end-of-file is encountered. If the
<indexterm><primary>Declarations</primary></indexterm>
<indexterm><primary>Non-Executable Statements</primary></indexterm>
-<para>Declarations are non-executable statements, and, except for function
-declarations, they may occur anywhere in the program. Their purpose
-is to furnish information to the translator program or to the reader
-of the program. Declarations may have statement labels, but these
-labels are ignored by the translator, and may not be referred to in
-other statements.</para>
+<para>Declarations are non-executable statements, and, except for
+function declarations, they may occur anywhere in the program. Their
+purpose is to furnish information to the translator program or to the
+reader of the program. Declarations may have statement
+labels,<indexterm><primary>Statement Labels</primary></indexterm> but
+these labels are ignored by the translator, and may not be referred to
+in other statements.</para>
<sect2><title>Remark Declaration</title>
). Other automatic assignments of modes are:</para>
<!-- beginpage II.36 -->
+<!-- not clear what this is referring to -->
+<indexterm><primary>Single Variable</primary></indexterm>
+
<orderedlist numeration='loweralpha'>
<listitem><para>A name appearing in the statement label field is
assigned statement label mode (see <xref
-linkend='statement_labels'/>).</para></listitem>
+linkend='statement_labels'/>)<indexterm><primary>Statement
+Labels</primary></indexterm>.</para></listitem>
<listitem><para>A function name<indexterm><primary>Function
Name</primary></indexterm> constant is assigned function name mode
<para>Dimensioning is automatic in two situations</para>
-<para>(a) In case a statement label vector, say L, is used (see <xref
-linkend='statement_labels'/>) and n is the highest subscript used on L
-in the statement label field (i.e., if L(m) appears then m ≤ n),
+<para>(a) In case a statement label
+vector,<indexterm><primary>Statement Label
+Vector</primary></indexterm> say L, is used (see <xref
+linkend='statement_labels'/>) and n is the highest subscript used on
+L in the statement label field (i.e., if L(m) appears then m ≤ n),
then n + 1 locations are reserved for L. L may also appear in a
dimension declaration in which case the highest linear subscript is
used.</para>
by a VECTOR VALUES statement. Vectors which have been assigned to the
PROGRAM COMMON section of storage (see section 3.6) can be preset with
<emphasis>numerical or alphabetical </emphasis> information only (not
-statement labels or function names) and then only if it is a single
-section program (i.e., storage is loaded with instructions only once)
-or, if it is a multiple section program, the PROGRAM
+statement labels<indexterm><primary>Statement
+Labels</primary></indexterm> or function names) and then only if it is
+a single section program (i.e., storage is loaded with instructions
+only once) or, if it is a multiple section program, the PROGRAM
COMMON<indexterm><primary>PROGRAM COMMON</primary></indexterm> region
is identical in all sections of the program.</para>
<para>The name of a function with the period deleted must not be used
as the name of a variable or as a statement label. A statement label
-must not be identical with any variable name.</para>
+must not be identical with any variable
+name.<indexterm><primary>Statement Labels</primary></indexterm></para>
<para>The translator automatically calls on some subroutines, hence the
following names may not be used as variable names or statement labels
<indexterm><primary>PUNCH Subroutine</primary></indexterm>
<indexterm><primary>READ Subroutine</primary></indexterm>
<indexterm><primary>SETEOF Subroutine</primary></indexterm>
+<indexterm><primary>SETETT Subroutine</primary></indexterm>
+<indexterm><primary>SYSTEM Subroutine</primary></indexterm>
+<indexterm><primary>Subroutines</primary></indexterm>
<!-- beginpage II.49 -->
<para>If a block designation
<indexterm><primary>Business Data Processing Examples</primary></indexterm>
<indexterm><primary>Examples, Business Data Processing</primary></indexterm>
+<indexterm><primary>Social Security Example</primary></indexterm>
<sect2><title>Example 1<emphasis role='note'>: Payroll Processing</emphasis></title>
<indexterm><primary>Exammples, Recursive Functions</primary></indexterm>
<indexterm><primary>Examples, Symbol Manipulation</primary></indexterm>
-<indexterm><primary>Rrcursive Functions</primary></indexterm>
+<indexterm><primary>Recursive Functions</primary></indexterm>
+<indexterm><primary>Subroutines</primary></indexterm>
+<indexterm><primary>Symbol Manipulation Examples</primary></indexterm>
<para><emphasis>Problem:</emphasis> Find the first occurrence of an
arbitrary word in a given text.</para>
</sect1>
<sect1><title>Structure of Subroutines</title>
+<indexterm><primary>Subroutines</primary></indexterm>
+
<note><para>This section describes the mechanics of writing
MAD-accessible subroutines in IBM 709 assembler. For tolerably
obvious reasons, the Retrocomputing Museum implementation does
</programlisting>
<para>Input-output routines utilize two types of parametersⅆthe
-regional and single variable types. In addition an error return is
-given as well as a format specification location. The parameter
-operation code used is TXI and the end of the parameter list is
-indicated by a TXI operation with a blank address. Thus the
-statement</para>
+regional and single variable types.<indexterm><primary>Subroutine
+Parameters</primary></indexterm> In addition an error return is given
+as well as a format specification location. The parameter operation
+code used is TXI and the end of the parameter list is indicated by a
+TXI operation with a blank address. Thus the statement</para>
<programlisting>
READ FORMAT FMT, BETA, X(1) ... X(100), K
<indexterm><primary>Precedence Hierarchy</primary><see>Parentheses</see></indexterm>
<indexterm><primary>R (Column 11)</primary><see>Remark Declaration</see></indexterm>
<indexterm><primary>Regional Notation</primary><see>Blocks, Input-Output</see></indexterm>
+<indexterm><primary>Specifications, Format</primary><see>Format Specifications</see></indexterm>
+<indexterm><primary>Statement, Execurtable</primary><see>Executable Statements</see></indexterm>
+<indexterm><primary>Statements,
+Input-Output</primary><see>Input-Output Statements</see></indexterm>
+<indexterm><primary>Statements,
+Non-Executable</primary><see>Non-Executable Statements</see></indexterm>
+<indexterm><primary>Subscript, Linear</primary><see>Linear Subscript</see></indexterm>
+<indexterm><primary>Subscript, Negative</primary><see>Negative Subscript</see></indexterm>
<index/>
</appendix>