<para>The Retrocomputing Museum implementation of MAD translates MAD
code into compileable C. It has been tested on the examples in the
-manual, which are included with the distribution.</para>
+manual, which are included with the distribution. This section is
+a summary of differences: more details are given in notes attached
+to the relevant sections.</para>
<para>Card images are read from standard input and printing is to
-standard output. Printer control codes +, 1, 2 and 4 are ignored
-(treated as 0 or space). Tape and drum devices are not
-supported.</para>
+standard output. Line printer control codes are partly but not exactly
+simulated (see <xref linkend='lptcodes'/>). Tape and drum devices are
+not supported.</para>
<para>The 704 had 36-bit words; MAD floats are translated to C
doubles, which on modern machines have 32 or 64 bits. Precision and
result into PIC and XML-DocBook markup so both HTML and PostScript can
be generated from it.</para>
+<note><para>Redactor's comments in the body of the text are
+decorated like this.</para></note>
+
<para>Typewriter underlining in the original is expressed by
DocBook <emphasis> tags in this version, which will probably
render as italics.</para>
hand-drawn across them). The original also some contained hand-drawn
script characters:</para>
-<para role='notebox'>Redactor's comments in the body of the text are
-decorated like this.</para>
+<para>The above notes fail to properly convey just how primitive the
+original document looks to a modern eye, and this is worth noting
+because this transcription into DocBook makes it look a lot less so.
+Standards have risen in a world saturated with the Web and cheap page
+printers. The original manual's monospace fonts on yellowing paper
+with hand-drawn figures and special characters look quaint and
+ugly by contrast.</para>
<informaltable>
<tgroup cols='2'>
the computer. Such details are fully presented <!-- beginpage --> in
Chapter II of this manual.)</para>
-<para role='notebox'>The IBM 704 on which MAD was implemented had a
+<note><para>The IBM 704 on which MAD was implemented had a
very primitive pre-ASCII character set. It did not even include
lowercase letters, let alone fancy punctuation like < and >.
ASCII still lacks ≤ and ≥, but writing these as <= and >=
-became universal in later ASCII-based languages.</para>
+became universal in later ASCII-based languages.</para></note>
<para>The flow diagram for our previous example, then, may be
rewritten as follows: (In order to keep the notation familiar when
<para>The first statement, labelled GAMMA, would cause the program to
read from the data card the numbers a, b, c, x<subscript>0</subscript>,
-ε<subscript>=1</subscript>, ε<subscript>2</subscript>, and
+ε<subscript>1</subscript>, ε<subscript>2</subscript>, and
n<subscript>0</subscript>. The format of the input information is to
be found in a block of storage labelled "CARD" whose values are set
later in the program by a VECTOR VALUES statement. The vector CARD
+0, -0. 100 are all integers). Leading (but not following) zeros may
be omitted (e.g., 5 and 005 represent the same integer, but 3 and 300
do not.</para>
+
+<note><para>There is a subtle difference from modern practice here.
+In 2004, major contemporary languages (perhaps unfortunately) follow
+C's lead and interpret leading 0 as a directive to evaluate the
+following digits in octal. The Retrocomputing Museum implementation
+of MAD implements the original MAD behavior.</para></note>
</sect3>
<sect3><title>Floating Point Constants</title>
characters by adding blanks on the right; thus $ABCD$ will appear
internally as $ABCD□□$
</para>
+
+<note><para>The Retrocomputing Museum implementation neither enforces
+the six-character limit nor blank-pads constants. These features were
+an artifact of packing six-bit characters into the IBM 704's 36-bit
+machine word.</para></note>
</sect3>
<sect3><title>Boolean Constants</title>
may be necessary before some of the operations can be performed.
Thus, in the expression</para>
-<literallayout>
+<para role='centered'>
Y + 3
-</literallayout>
+</para>
<para>if Y is in the floating point mode it cannot be added directly
to the integer 3. But for one precaution the user need not be
<para>In some cases, however, the user must understand the sequence in
which the conversions will be made. Consider the expression</para>
-<literallayout>
+<para role='centered'>
( Y + 7/3) + (I * J/K)
-</literallayout>
+</para>
<para>where Y is in the floating point mode, and I, J, and K are in the
integer mode. According to the parenthesizing conventions, the
<para>In the example above, the divisions would be performed in the
floating point mode if the expression were written:</para>
-<literallayout>
+<para role='centered'>
(Y + 7./3) + (I * J)/(K + 0.)
-</literallayout>
+</para>
<para>Of course, many times the expression will be written as
originally stated just to achieve the "truncation" effect.</para>
<!-- beginpage -->
<para>This statement has the form illustrated by</para>
-<programlisting>
+<para role='centered'>
ALPHA = Y + Z + F.(X, Y, Z)
-</programlisting>
+</para>
<para>That is, the left side of the "=" sign consists of the name of a
variable (either an individual variable or a subscripted array
<para>Thus, if Y is a floating point variable, then the statement</para>
-<programlisting>
+<para role='centered'>
Y = 1
-</programlisting>
+</para>
<para>will cause the integer 1 to be converted to floating point and then
stored in the location called "Y"; i.e., Y will now have the value 1.
(as a floating point number). If the statement were written</para>
-<programlisting>
+<para role='centered'>
Y = 1.
-</programlisting>
+</para>
<para>then the floating point number 1. would be stored in the
location "Y"; i.e., Y would again have the floating point value 1.,
fractional part, and then the fractional part is truncated. Thus, the
following floating point numbers:</para>
-<programlisting>
+<para role='centered'>
3E5, .3E0, .34568127E2, - .345681E10
-</programlisting>
+</para>
<para>would convert to the following integers, respectively:</para>
-<programlisting>
+<para role='centered'>
300000, 0, 34, -3456810000.
-</programlisting>
+</para>
</sect2>
<sect2><title>Transfer Statement</title>
<para>(a) Simple Conditional</para>
-<programlisting>
+<para role='centered'>
WHENEVER B,Q
-</programlisting>
+</para>
<para>Here B is a Boolean expression and Q any executable statement
except the following: end of program, another conditional, iteration,
<para>Examples:</para>
-<programlisting>
+<para role='centered'>
WHENEVER XM.LE.1, TRANSFER TO END
WHENEVER I.GE.N.AND.J.NE.I-1, I=0
-</programlisting>
+</para>
<para>(b) Compound Conditional</para>
which will be displayed on the computer console for the operator to
note when the computer stops, thus indicating the point in the program
at which the stop occurred.</para>
+
+<note><para>The Retrocomputing Museum implementation handles this by
+generating code that prints the octal number to standard output, then
+waits for the user to press Enter.</para></note>
</sect2>
<sect2><title>Function Statement</title>
statement to which a transfer is made in case the ERROR RETURN
statement is executed.</para>
+<note><para>This language is confusing, and doesn't seem to match the
+actual uses of ERROR RETURN in the examples. The Retrocomputing
+Museum implementation ignores it.</para></note>
+
<para>Even though an error return has been provided in the definition
of a function, in the use of the function the last argument may be
omitted. If it is omitted, execution of the ERROR RETURN statement
operating system in which the translated program is imbedded, with an
error indication.</para>
+<note><para>The Retrocomputing Museum implementation generates code
+that prints ERROR RETURN and terminates the program.</para></note>
+
</sect2>
<sect2><title>End of program Statement</title>
</programlisting>
<para>where &scriptN; is the name of this entry (see section 3.8).</para>
+
+<note><para>The Retrocomputing Museum implementation supports only
+one entry point per function. Attempting to specify more than one
+will raise a compile-time error.</para></note>
+
</sect2>
<sect2><title>List Manipulation Statements</title>
</tgroup>
</informaltable>
+<note id='lptcodes'>
+<para>These were the standard control codes for line printers, which
+assumed they were printing to 132x66 fanfold paper. There isn't a lot
+of point in simulating them on a modern page printer. The
+Retrocomputing Museum implementation implements them by prefixing the
+output string:</para>
+
+<informaltable frame='none' colsep='0' rowsep='0' role='centered'>
+<tgroup cols='2'>
+<tbody>
+<row><entry>Blank </entry> <entry>No prefix</entry></row>
+<row><entry>0 </entry> <entry>\n</entry></row>
+<row><entry>+ </entry> <entry>Not supported, no prefix.</entry></row>
+<row><entry>1 </entry> <entry>Form feed</entry></row>
+<row><entry>2 </entry> <entry>Two vertical tabs</entry></row>
+<row><entry>4 </entry> <entry>One vertical tab</entry></row>
+</tbody>
+</tgroup>
+</informaltable>
+</note>
+
<para>As another example, the specification</para>
<para role='centered'>