<!ENTITY scope3 SYSTEM "scope3.xml">
<!ENTITY scope4 SYSTEM "scope4.xml">
-<!ENTITY statement "&sgr;">
+<!ENTITY scriptA "ℜ"> <!-- mapped to script R -->
+<!ENTITY scriptF "ℬ"> <!-- mapped to script B -->
+<!ENTITY scriptL "ℒ"> <!-- this is a script L -->
+<!ENTITY scriptN "ℳ"> <!-- mapped to script M -->
+<!ENTITY scriptS "&sgr;"> <!-- mapped to sigma -->
+<!-- also available; script H is ℋ -->
]>
<book>
<preface><title>Notes from the 21st century</title>
(treated as 0 or space). Tape and drum devices are not
supported.</para>
-<para>The 709 had 36-bit words; modern machines have 32 or 64.
-Precision and overflow of numeric results may therefore differ.
-The original MAD limit of 6 characters on variable names, labels, and
-string constants is not enforced.</para>
+<para>The 709 had 36-bit words; MAD floats are translated to C
+doubles, which on modern machines have 32 or 64 bits. Precision and
+overflow of numeric results may therefore differ. The original MAD
+limit of 6 characters on variable names, labels, and string constants
+is not enforced.</para>
<para>Label arrays, array-mode variables, and the associated
-computed-transfer statement are not implemented.</para>
+computed-transfer statement are not implemented. Neither are ERROR
+RETURN, multiple ENTRY points, or TAPE and DRUM statements.</para>
+
+<para>All external function definition must precede
+the program main line.</para>
<para>The generated C is self-contained and does not require any
dedicated runtime support, except that the stdio and math libraries
<para>In the original, sections were numbered only down to three
levels deep. No per-chapter tables of contents were present.</para>
-<para>The item lists bulleted a., b., c... and 1., 2, 3... in this
+<para>The item lists bulleted a., b., c... and 1., 2., 3.... in this
transcription were bulleted (a), (b), (c)... and (1), (2), (3)...
in the original. There does not seem to be a good way to generate
the original style in DocBook.</para>
<para>Special characters like white square (□), back arrow
(←), and the Greek letters were hand-drawn in the original
(except for the capital thetas, which were typed capital Os with bars
-hand-drawn across them). The script-S used in the original as a base
-for subscripted labels has no ISO equivalent and has been transcribed as
-a Greek letter sigma (&statement;). The script-N used at some
-places in the original has been replaced by a script M, ℳ.</para>
+hand-drawn across them). Several other special characters represent
+hand-drawn script characters:</para>
+
+<informaltable>
+<tgroup cols='2'>
+<thead>
+<row>
+<entry align='center'>in the original:</entry>
+<entry align='center'>used for:</entry>
+<entry align='center'>represented as:</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry align='center'>script-A</entry>
+<entry>address metavariables</entry>
+<entry align='center'>&scriptA;</entry>
+</row>
+<row>
+<entry align='center'>script-F</entry>
+<entry>format metavariables</entry>
+<entry align='center'>&scriptF;</entry>
+</row>
+<row>
+<entry align='center'>script-L</entry>
+<entry>list metavariables</entry>
+<entry align='center'>&scriptL;</entry>
+</row>
+<row>
+<entry align='center'>script-N</entry>
+<entry>general metavariables</entry>
+<entry align='center'>&scriptA;</entry>
+</row>
+<row>
+<entry align='center'>script-S</entry>
+<entry>statement metavariables</entry>
+<entry align='center'>&scriptS;</entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
<para>Footnotes were tagged with asterisks in the original rather than
being numbered. Section references to section numbers have been
the function now need only call upon it by name, as in the statement:</para>
<programlisting>
-LARGEQ = 1. + MAS. (6,Q)/3.
+LARGEQ = 1. + MAX. (6,Q)/3.
</programlisting>
<para>Note that the set (in this use of MAX.) hose largest element is
<sect2><title>Transfer Statement</title>
-<para>This statement has the form: TRANSFER TO &statement;</para>
+<para>This statement has the form: TRANSFER TO &scriptS;</para>
-<para>Here &statement; may be any statement label or any expression in
+<para>Here &scriptS; may be any statement label or any expression in
<!-- beginpage -->
statement label mode which labels an executable statement. Execution
of this statement causes the computation to continue from the
-statement whose label is the value of &statement;. Examples: TRANSFER TO
+statement whose label is the value of &scriptS;. Examples: TRANSFER TO
SUMX, TRANSFER TO SWTCH (K + 2) (if K=4 then the value of SWTCH(K+2)
is SWTCH(6)).</para>
<!-- Original has hand-drawn large right curly braces pointing at each -->
<!-- theta from the left, indicating the scope of the conditional body -->
<programlisting>
- &statement;<subscript>1</subscript> WHENEVER B<subscript>1</subscript>
+ &scriptS;<subscript>1</subscript> WHENEVER B<subscript>1</subscript>
...
... &THgr;<subscript>1</subscript>
- &statement;<subscript>2</subscript> OR WHENEVER B<subscript>2</subscript>
+ &scriptS;<subscript>2</subscript> OR WHENEVER B<subscript>2</subscript>
...
... &THgr;<subscript>2</subscript>
...
...
- &statement;<subscript>k</subscript> OR WHENEVER B<subscript>k</subscript>
+ &scriptS;<subscript>k</subscript> OR WHENEVER B<subscript>k</subscript>
...
... &THgr;<subscript>k</subscript>
- &statement;<subscript>k</subscript>+1 END OF CONDITIONAL
+ &scriptS;<subscript>k</subscript>+1 END OF CONDITIONAL
</programlisting>
<para>Often the last condition B<subscript>k</subscript> is always
OTHERWISE
</programlisting>
-<para>The &statement;<subscript>i</subscript> are statement labels which
+<para>The &scriptS;<subscript>i</subscript> are statement labels which
need not be used unless desired. k may equal one (if no "OR
WHENEVER..." statements are used). Here B<subscript>1</subscript>,
..., B<subscript>k</subscript> are Boolean expressions, and the
0B, then B<subscript>2</subscript> is tested, etc. As soon as some
expression, say B<subscript>j</subscript>, has the value 1B, then the
statements between (but not including)
-&statement;<subscript>j</subscript> and
-&statement;<subscript>j+1</subscript>
+&scriptS;<subscript>j</subscript> and
+&scriptS;<subscript>j+1</subscript>
(i.e. &THgr;<subscript>j</subscript>) are executed. At this point the
execution of the entire block is considered ended, and computation
continues from the first statement after the declaration labelled
-&statement;<subscript>k+1</subscript>. In other words, at most one of
+&scriptS;<subscript>k+1</subscript>. In other words, at most one of
the alternative computations is performed; e.g., that one which
immediately follows the first expression B<subscript>1</subscript>
which has the value 1B. If none of the B<subscript>i</subscript> has
satisfied. The THROUGH statement may take either of the following two
forms.</para>
-<para>(a) THROUGH &statement;, FOR VALUES OF V =
+<para>(a) THROUGH &scriptS;, FOR VALUES OF V =
E<subscript>1</subscript>, E<subscript>2</subscript>, ...,
-E<subscript>m</subscript></para> <para>Here &statement; is the statement
+E<subscript>m</subscript></para> <para>Here &scriptS; is the statement
label of the last executable statement in the block to be repeated.
The block of statements following (and not including) the THROUGH
statement, up to <emphasis>and including</emphasis> the statement
-whose label is &statement;, will be called the "scope" of the THROUGH
+whose label is &scriptS;, will be called the "scope" of the THROUGH
statement. Following the word OF appears the name of the iteration
variable (in <!-- beginpage -->the illustration: V), which may be
either an individual variable or subscripted array variable of any
"scope" to be executed, first with V = E<subscript>1</subscript>, then
again with V = E<subscript>2</subscript>, and so on, until the list of
expressions is exhausted. Computation then proceeds with the
-statement immediately following statement &statement;. At this time the
+statement immediately following statement &scriptS;. At this time the
iteration variable will have the value of the expression
E<subscript>m</subscript> unless <!-- beginpage -->its value was
changed during the final iteration. An example of this type of
A X(BETA) = J1 * COS.(2. * THETA)
</programlisting>
-<para>(b) THROUGH &statement;, FOR V = E<subscript>1</subscript>,
+<para>(b) THROUGH &scriptS;, FOR V = E<subscript>1</subscript>,
E<subscript>2</subscript>, B</para>
-<para>Here &statement; is a statement which defines the "scope" exactly
-as in (a) above (with the exception: If &statement; is the label of the
+<para>Here &scriptS; is a statement which defines the "scope" exactly
+as in (a) above (with the exception: If &scriptS; is the label of the
THROUGH statement itself, the iteration will proceed as described
below, but the scope will be empty, and the iteration will consist
only of the incrementing of V by E<subscript>2</subscript> and the
= 0B, the scope is executed. V is then incremented by
E<subscript>2</subscript>, and B is tested again. In general, as soon
as B = 1B, the scope is not executed, and the computation proceeds
-from the statement immediately following statement &statement;. Each
+from the statement immediately following statement &scriptS;!. Each
time B = 0B, the statements in the scope are executed, then V is
incremented by E<subscript>2</subscript>, and B is tested again.
Thus, when the iteration is finished and B = 1B, V has the value used
<para>where ℳ is the name of this entry (see section 3.8).</para>
</sect2>
+<sect2><title>List Manipulation Statements</title>
+
+<para>These statements facilitate the writing of recursive internal and
+external functions. (see section 3.8) They cause the designation and
+use of a vector for the temporary storage of data and action transfer
+instructions. (i.e. function returns).</para>
+
+<orderedlist numeration='loweralpha'>
+<listitem>
+<!-- in the original, there was something like a script V here -->
+<para>SET LIST TO &scriptL;</para>
+
+<para>&scriptL; is the name of an array element designated as the initial
+location to be used for temporary storage. Consecutive elements will
+be used as required by the following statements.</para>
+</listitem>
+<listitem>
+<para>SAVE DATA &scriptL;</para>
+
+<para>&scriptL; is a list of: 1) single or subscripted variable names, 2) array
+segments of the form A(i<subscript>1</subscript>, ...,
+i<subscript>n</subscript>) ... A(j<subscript>1</subscript>, ...,
+j<subscript>n</subscript>) where the i, j subscripts may be any valid
+subscript expression and n ≥ 1, 3) constants, or 4)
+expressions—separated by commas. This statement causes the current
+values of the elements of the list as consecutive elements of the
+currently designated temporary storage vector—starting with the first
+currently available element. &scriptL; is the same as any input-output list
+(see sec. 2.14).</para>
+</listitem>
+<listitem>
+<para>SAVE RETURN</para>
+
+<para>This statement will appear in the scope of the definition of a
+function (see section 3.8) and cause the reentry point to the calling
+program to be stored as the next available element of the currently
+designated temporary storage vector.</para>
+</listitem>
+<listitem>
+<para>RESTORE DATA &scriptL;</para>
+
+<para>&scriptL; is a list of single or subscripted variable names or
+array segments of the type described in (b). If the list designates n
+names (not necessarily n items in the list) the values of the last n
+elements of the currently designated temporary storage vector become
+the values of the list variables. The order of this value assignment
+assuming k used locations in temporary storage vector, left to right
+in the list correspond to k, k-1, ... k - n + 1 elements of the
+temporary storage vector are then made available for use by successive
+SAVE statements.</para>
+</listitem>
+<listitem>
+<para>RESTORE RETURN</para>
+<para>This statement will appear in this scope of a function definition and
+causes the current last element in the currently designated temporary
+storage vector to be used as the reentry point to the program calling
+the function. The last element of temporary storage is then made
+available for use by successive SAVE statements.</para>
+</listitem>
+</orderedlist>
+</sect2>
+<sect2><title>Input-Output Statements</title>
+
+<para>In this section the follwing definition the following
+definitions will hold. &scriptF; is the location of a format
+specification vector (see section 2.15) which must be an integer
+variable name. &scriptN; is an expression whose value is to be either
+a tape number or a drum number. &scriptL; is an input-output list.
+Elements of &scriptL; may be: 1) single variable names or array names
+with subscripts;, 2) blocks of the form A(i<subscript>;i</subscript>;,
+..., i<subscript>;n</subscript>;) ... A(j<subscript>;i</subscript>;,
+...j<subscript>;n</subscript>;) where the i's and j's may be any
+subscript ;expression and n # 1. In addition, when &scriptL;
+designates an output list, the elements of &scriptL; may be: 3)
+constants or 4) expressions. Elements of a list are separated by
+commas. Example of an output list: AB, D, 2.5, MTX(1) ... MTX(N),
+P(14), J(I, K). Example of a list which may be ysed either for input
+or output: A, B, K(3), J(25*I - L), A(K+1)... A(L*2). To completely
+understand the operation of statements which make an explicit
+reference to "TAPE" or "DRUM" it is advisable to read the sections of
+the IBM 704 Reference Manual which describes the operation of these
+units (See <emphasis>Restrictions</emphasis> below).</para>
+
+<variablelist>
+<varlistentry>
+<term>(a) PRINT FORMAT &scriptF;, &scriptL;</term>
+<listitem>
+<para>Prints &scriptL; according to format &scriptF; on the off-line
+printer.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(b) PRINT ON LINE FORMAT &scriptF;, &scriptL;</term>
+<listitem>
+<para>Prints &scriptL; according to format &scriptF; on the on-lin
+printer. This statement is used for comments to the operator. After
+&scriptL; has been printed a skip of 1/6 page is automatically
+produced, allowing the operator to read the comment.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(c) PUNCH FORMAT &scriptF;, &scriptL;</term>
+<listitem>
+<para>Punches &scriptL; on cards according to format &scriptF;.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(d) READ FORMAT &scriptF;, &scriptL;</term>
+<listitem>
+<para>Reads cards into &scriptL; according to format &scriptF;.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(e) READ BCD TAPE &scriptN;, &scriptF;, &scriptL;</term>
+<term>WRITE BCD TAPE &scriptN;, &scriptF;, &scriptL;</term>
+<listitem>
+<para>Transmits &scriptL; to or from tape &scriptN; in BCD form
+according to format &scriptF;.
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(f) READ BINARY TAPE &scriptN;, &scriptL;</term>
+<listitem>
+<para>Transmit to &scriptL; from tape &scriptN; until &scriptL; is exhausted or a complete type record has been read.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>WRITE BINARY TAPE &scriptN;, &scriptL;</term>
+<listitem>
+<para>Transmits &scriptL; to tape &scriptN; in binary form as one
+record.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(g) READ DRUM &scriptN;, &scriptA;, &scriptL;</term>
+<term>WRITE DRUM &scriptN;, &scriptA;, &scriptL;</term>
+<listitem>
+<para>Transmits &scriptL; to or from drum &scriptN; starting with drum
+address &scriptA; (where &scriptA; is an integer expression).</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(h) REWIND TAPE &scriptN;</term>
+<listitem>
+<para>Rewinds tape &scriptN;.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(i) END OF FILE TAPE &scriptN;</term>
+<listitem>
+<para>Writes an end of file mark on tape &scriptN;.
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(j) BACKSPACE RECORD OF TAPE &scriptN;</term>
+<listitem>
+<para>Move tape &scriptN; back to beginning of last record.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>(k) BACKSPACE FILE OF TAPE &scriptN;, IF LOAD POINT TRANSFER TO &scriptS;</term>
+<listitem>
+<para>Tape &scriptN; is moved backward until an en-of-file mark, the
+load point gap, or the load point is encountered. If an end-of-file
+mark has been written previously, executing this statement backspaces
+over the end-of-file mark and stops just in front of it (since the
+end-of-file mark must be passed over to be recognized). If the tape is
+already at the load point, the program goes to the executable
+statement labelled &scriptS; (where &scriptS; is a statement label or
+variable of statement label mode.) If the phrase ", IF LOAD POINT
+TRANSFER TO &scriptS;" (including the comma) is omitted no transfer is
+made even if at load point.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<sect3><title>End of File and End of Tape</title>
+
+<para>If an error (improperly formed format specifications, invalid data, a
+tape check, etc.) occurs during any input-output statement except READ
+DRUM or WRITE DRUM, the subroutine ERROR. is automatically entered.
+The subroutine ERROR. sets an error flag and returns control to the
+system in which the translated program is imbedded.</para>
+
+<para>If an end-of-file is encountered while executed a READ FORMAT,
+READ BCD TAPE, or READ BINARY TAPE statement the subroutine SYSTEM. (a
+subroutine which returns control to the system in which the translated
+program is imbedded) is automatically entered. This action can be
+changed by executing the statement EXECUTE SETEOF. (&scriptS;). The
+subroutine SETEOF. sets the read routines to transfer to the
+executable statement labelled &scriptS; when an end-of-file is
+encountered. If the statement EXECUTED SETEOF. (0) is executed the
+read routines will be reset to enter SYSTEM. when an end-of-file is
+encountered.</para>
+</sect3>
+</sect2>
</sect1>
</chapter>
</book>
+<!--
+Local Variables:
+compile-command: "make mad-manual.html"
+End:
+-->
+