the rest of the instruction in (or after) column 12. Blanks are
ignored throughout, except in operating codes.</para>
+</sect2>
+<sect2><title>Operation Codes</title>
+
+<programlisting>
+ACL LDA STA
+ADD LDQ STD
+ADM LFM STO
+ALS LGL STP
+ANA LLS STQ
+
+
+ANS LRS STZ
+ARS LTM SUB
+BSF LXA SXD
+BST LXD TIX
+CAD MPR TLQ
+
+CAS MPY TMI
+CHS MSE TNO
+CLA NOP TNX
+CLM ORA TNZ
+CLS ORS TOV
+
+COM PAX TPL
+CPY PBT TOC
+DCT PDX TQP
+DVH PSE TRA
+DVP PXD TSX
+
+EFM RDS TTR
+ETM REW TXH
+ETT RND TXI
+FAD RQL TXL
+FDH RTT TZE
+
+FDP SBM UFA
+FMP SLQ UFM
+FSB SLW UFS
+HPR SSM WEF
+HTR SSP WRS
+LBT
+</programlisting>
+
</sect2>
</sect1>
</appendix>
+<appendix><title>Simplified Input-Output Statements</title>
+
+<sect1><title>(a) READ DATA</title>
+
+<para>This statement causes information to be read from cards; no list of
+variable names or format specification is necessary. The values to be
+read and the variable names are punched in the data cards in a
+sequence of fields of the form:</para>
+
+<para role='centered'>v<subscript>1</subscript> = n<subscript>1</subscript>, v<subscript>2</subscript> = n<subscript>2</subscript> , v<subscript>3</subscript> = n<subscript>3</subscript>, ...., v<subscript>k</subscript> = n<subscript>k</subscript> *</para>
+
+<para>The v<subscript>1</subscript>, ..., v<subscript>k</subscript> are the
+variable names and n<subscript>1</subscript>, ... ,
+n<subscript>k</subscript> are the corresponding values. Reading is
+continued from card to card until the terminating mark * is
+encountered. Fields cannot be divided between cards, so the last
+character in a card not terminated by an asterisk would normally be a
+comma. However, as a convenience, the end of the card is treated as
+an implied comma and hence this final comma may be omitted. The
+variable names may designate single variables or elements of linear
+and two-dimensional arrays. The subscripts on the array vaiables must
+be integer constants. The values may be floating point, integer,
+octal, Boolean, or alphabetic with the forms descibed in the section
+on constants in the MAD manual (See section
+<xref linkend='constants'/>).</para>
+
+<para>For convenience in entering values of array elements it is
+possible to designate only one variable name and have successive
+numbers, written without names, interpreted as the consecutive values
+of the array, i.e.,</para>
+
+<para role='centered'>V(j) = n<subscript>1</subscript>, n<subscript>2</subscript>, n<subscript>3</subscript> . . . , n<subscript>k</subscript></para>
+
+<para>would be the same as</para>
+
+<para role='centered'>V(j) = n<subscript>1</subscript>. V(j + 1) + n<subscript>2</subscript>, ..., V(j + k - 1_ = n<subscript>k</subscript></para>
+
+<para>For 2-dimensional arrays successive numbers will be entered in
+succeeding columns of the designated row until the row - as determined
+from the current value of the dimension vector - is filled, and then
+the next row will be started.</para>
+
+<para>Zeros must be punched; adjacent commas (,,) are simply skipped.
+Blanks are ignored throughout except between dollar signs (which are
+used only to delimit a string of Hollerith characters).</para>
+
+<para>Six or less Hollerith characters - delimited by dollar signs -
+may be values of single integer variables. Longer strings of
+Hollerith characters may be entered as elements of arrays. Such
+strings are divided into six character groups for storage.</para>
+
+<para>As an example illustrating many of the features described herein
+consider the data card set:</para>
+
+<programlisting>
+ X1 = 1.2, Y1 = -6.8, INDEX = 4, A(4) = 3.1, -10.93,
+ 12.6, MATRIX (2,1) = 25 E-2, 1.8 E-10, 3.14 E-8,
+ STRING (1) = $ END OF PROBLEM $ *
+</programlisting>
+
+<para>It is important to remember that, since such cards are data
+cards, they should not be included as an integral part of the MAD
+statements but handled as ordinary data.</para>
+
+</sect1>
+<sect1><title>(b) PRINT COMMENT &scriptS;</title>
+
+<para>Here &scriptS; designates a string of no more than 120 Hollerith
+characters. These characters may not include dollar signs and here
+blanks are valid characters. The string, delimited by dollar signs as
+indicated, will be printed. The first character will be interpreted
+as a carriage control code and will not be printed. For convenience
+the carriage control code is reproduced here:</para>
+
+<informaltable frame='none' colsep='0' rowsep='0' role='centered'>
+<tgroup cols='2'>
+<thead>
+<row><entry>Character</entry><entry>Result</entry></row>
+</thead>
+<tbody>
+<row><entry>blank </entry> <entry>single space</entry></row>
+<row><entry>+ </entry> <entry>no space</entry></row>
+<row><entry>- </entry> <entry>triple space</entry></row>
+<row><entry>0 </entry> <entry>double space</entry></row>
+<row><entry>1 </entry> <entry>space to top of next page</entry></row>
+<row><entry>2 </entry> <entry>space to next half-page</entry></row>
+<row><entry>4 </entry> <entry>space to next quarter page</entry></row>
+<row><entry>8 </entry> <entry>space to next one sixth page</entry></row>
+</tbody>
+</tgroup>
+</informaltable>
+
+<para>An example statement is:</para>
+
+<para role='centered'>PRINT COMMENT $1 JOHN PUBLIC, MATH 373 PROBLEM 1$</para>
+
+</sect1>
+<sect1><title>(c) PRINT RESULTS &scriptL;</title>
+
+<para>Here &scriptL; designates a list of variable names or block
+designations. Expressions may not appear in the list although
+subscripts of variables in the list may be expressions. The printed
+output is analogous to the input in that the numbers printed are
+preceded by the appropriate variable name and an equal sign - e.g., X
+= -12.4 - and only the initial elements of arrays are so labelled.
+Elements of three and higher demensional [typo?] arrays will be
+labelled with the equivalent linear subscript. If dummy variables (in
+a function definition) are included in the list the specific values
+assigned to such variables during execution will not be labelled but
+simply preceded by ... .</para>
+
+<para>An example statement is:</para>
+
+<para role='centered'>PRINT RESULTS X1, Y1, Z(1) . . . Z(N + 1), MTX (1,1) ...MTX(M,N)</para>
+
+</sect1>
+</appendix>
+<appendix><title>Supplement to the MAD Manual</title>
+
+<para role='centered'>November 15, 1960</para>
+
+<para>The notes which appear below describe several new features which have
+been added to MAD. Existing programs need not be changed in any way.
+Most programs will be reduced in size and execution time, however, if
+they are recomplied to take advantage of the internal improvements
+that have been made with regard to the translation of Boolean
+expressions and which are described below (see (8)). Included here,
+also, are some comments on reducing the size of some subroutines.</para>
+
+<para>(1) The Appendix to this supplement describes the new DEFINE facility.
+By means of this facility, new operators can be added temporarily to
+MAD, as well as new modes of arithmetic.</para>
+
+<para>(2) Along with integer, floating point, Boolean, and alphabetic
+constants, one may now write <emphasis>octal</emphasis> constants.
+These constants are written as twelve digit octal integers followed by
+the letter K, except that leading zeros may be omitted. If one or
+more <emphasis>decimal</emphasis> digits follow the letter K, this is
+interpreted as an octal scale factor. This 127K2 would be the octal
+integer 000000012700, and 1K10 would produce the octal number
+010000000000.</para>
+
+<para>(3) Any constant (integer, floating point, Boolean, alphabetic,
+or octal) may be declared to be of a mode other than its normally
+assigned mode by following the constant by the letter M and the digit
+code for that mode. The digit codes are:</para>
+
+<programlisting>
+ 0 Floating point
+ 1 Integer
+ 2 Boolean
+ 3 Function Name
+ 4 Statement Label
+</programlisting>
+
+<para>The new modes 5, 6, and 7, which may be defined as described in
+the Appendix, may also be used. The constant is converted
+<emphasis>as usual</emphasis>, but then is assigned the indicated
+mode, if the letter M is used. Thus, if some new mode numbered 6 were
+defined for certain integers, then the appearance of the constant 32M6
+would assign mode 6 to the decimal integer 32. The appearance of
+32KM6 would assign mode 6 to the octal constant 32, and the appearance
+of $AB$M6 would assign the mode 6 to the constant $AB$. Similarly,
+the appearance of 32.1E-1M6 would assign mode 6 to the number 3.21
+which appears in storage in the usual floating point form.</para>
+
+<para>(4) A subroutine is not available, called ZERO., which will
+accept as arguments single variables or blocks (i.e., an "input list")
+and very efficiently (i.e., using STZ and TIX operations) store +0 in
+these locations. This saves writing an iteration loop.</para>
+
+<para>(5) In addition to the usual notation for a block: e.g., A(6) ...A(N), MAD will now accept the traditional use of commas as well:</para>
+
+<para role='centered'>A(6), ... , A(N)</para>
+
+<!-- in the original, "debugging" was typoed as "degugging" -->
+<para>(6) A list of variables used in the program, but to which only one
+reference is made, is printed out for each MAD program. This list
+does not include any variables appearing in PROGRAM COMMON, ERASABLE,
+DIMENSION, VECTOR VALUES, or EQUIVALENCE statements. Variables
+appearing in this list are all assigned to the same location, under
+the assumption that they are not purposely used for anything except
+perhaps redundant labelling of statements. This list has proven to be
+a valuable debugging aid, since misspelled names almost
+invariably show up on this list. It should therefore be checked
+carefully whenever it appears.</para>
+
+<para>(7) In order to conserve storage, it may be desirable to store, for
+example, only one half of symmetric matrix or an upper (or lower)
+triangular matrix, etc. Perhaps only the non-zero elements of a
+sparse matrix might be stored, also. For such arrays, it is necessary
+to use a subscription subroutine other than the standard one supplied
+by MAD which expects to find the entire matrix stored by rows (in the
+two-dimensional case). Such special subscription subroutines may now
+be written as any other internal or external functions in MAD or in
+SAP, as usual. The arguments must be the array name, followed by the
+n subscripts (integer expressions) in the usual order. The value of
+the function which is to be computed is the <emphasis>linear
+subscript</emphasis> to be used to obtain the value desired. For
+example, if one wished to store only the upper triangle (plus
+diagonal) of an upper triangular two-dimensional array (by rows,
+starting as A(2)), the subscription function F, could be defined as
+follows: (We shall assume a constant zero stored at A(1))</para>
+
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='equation12.png'/>
+ </imageobject>
+</mediaobject>
+
+<para>where n is the nubmer of columns in the matrix A, and b is the
+base point. Of course, if n (and/or b) is not a constant, it will
+have to be made available to the subscription subroutine, probably via
+PROGRAM COMMON, as will the base point, if used. It will
+automatically be available, of course, if the subroutine is written as
+an <emphasis>internal</emphasis> function. Note that in the case i >
+j, we give as the value of F.(A,i,j) the <emphasis>linear
+subscript</emphasis> 1 of the value 0, rather than the value
+itself.</para>
+
+<para>In order to notify MAD that such a subscription function is to be
+used, one merely inserts the name of the function as the first entry
+of the dimension vector of the appropriate array, moving the number of
+dimensions, etc., down by one in the dimension vector. Thus, the
+above example might be indicated as follows:</para>
+
+<programlisting>
+ DIMENSION A(100, ADIM)
+ VECTOR VALUES ADIM = F.,2,2,10
+</programlisting>
+
+<para>if there were ten columns. Although dimension information could
+always be computed or brought in as data instead of via a VECTOR
+VALUES declaration, the one exception to this is now the name of the
+subscription function. If used, it <emphasis>must</emphasis> occur as
+the first entry in a VECTOR VALUES declaration, and it must be
+followed immediately by at least one integer in the same declaration.
+It should be understood that if this feature is used, references to
+matrix elements by means of subscripts are made as if the matrix were
+stored as originally described in the MAD manual. Thus, subroutines
+do not need to know whether a calling program is or is not using such
+storage conservation functions.</para>
+
+<para>Two special subscription functions are available from the subroutine
+library: (a) SYMM. will handle two-dimensional symmetric arrays for
+which only the upper half (plus diagonal) is stored by rows. (b)
+TRANSP. will handle a two dimensional array stored by rows (in full)
+but considered to be in transposed form. In other words, if a matrix
+B is designated as having subscription function TRANSP., then a call
+of B(6,2) will, in fact, produce the linear subscript of B(2,6).</para>
+
+<para>Both SYMM. and TRANSP. automatically have access to the dimension
+vector (including the base point), so no provision need to be made for
+putting any information in PROGRAM COMMON, for example. In fact, if
+the subscription function is written in SAP, it may be able to use the
+fact that MAD provides the address of the dimension vector in the
+decrement part of the parameter which contains the address of the
+array, in this case the first parameter. Note, however, that the
+dimension information has been moved down by one because of the
+presence of the name of the subscription function; and this must be
+accounted for in any references to the dimension vector.</para>
+
+<para>In order to accommodate this new feature, the MAD library
+subroutines (03310, (03311, and (MTX have been modified. Anyone using
+special subscription subroutines should discard any previously punched
+versions of these library subroutines. Note, also, that TRANS and
+TRANS1 may not be used for transposing matrices stored in short form,
+since they were not written to recognize special subscription
+fuctions.</para>
+
+<para>(8) A Boolean expression usually contins one or more atomic Boolean
+expressions consisteing of two arithmetic expressions on either side
+of a relation. Exampls of atomic Boolean expressions are X + 3
+.LE. Y, I, .E. 1, and so on. It has been found possible to save as
+many as 60% of the object program instructions formerly generated for
+atomic Boolean expressions. Moreover, the object programs now
+produced will skip the evaluation of the remaining terms of a
+disjunction (an "or" expression) as soon as one terms has the value
+1B, and a similar statement holds for conjunctions ("and"
+expressions). These changes are entirely internal to MAD, and require
+no change in MAD source programs. A recompilation will be necessary,
+however, to obtain the shorter, faster object program which results.
+In order to obtain the maximum benefit from the skipping behavior
+indicated above, it is necessary to understand that the atomic Boolean
+epxressions in a complex Boolean expression are evaluated from right
+to left, and the one most likely to be "true" in a conjunction, and
+the one most likely to be "false" in a conjunction, should be placed
+as far toward the right end of the expression as possible.</para>
+
+<para>Thus, if one were testing for values of X between 0 and 2 and
+between 5 and 6, one might write</para>
+
+<para role='centered'>WHENEVER 0 .L. X .AND X .L. .OR. 5 .L. X .AND X .L. 6</para>
+
+<para>If one knew that for the data expected, the values of X would
+occur most often between -1 and 2, one would do better to write the
+above as follows:</para>
+
+<para role='centered'>WHENEVER X .L. 6 .AND. 5 .L. X .OR. X .L. 2 .AND. 0 .L. X</para>
+
+<para>(9) There is a table within MAD in which are recorded all
+occurrences of parameters within an external or internal
+<emphasis>function definition</emphasis>. Since all such occurrences
+must be initialized on each entry to the subroutine, it is very
+desirable that the number of entries in this table be kept as small as
+possible. This is especially important when a diagnostic comment is
+generated saying that this table has in fact overflowed! (The
+diagnostic comment produced in this case is PARAMETER USE TABLE
+EXCEEDED.)</para>
+
+<para>There are several ways to cut down the entries in this table and
+thus speed up the execution of the subroutine and shorten its length
+as well. (1) If X is an <emphasis>input</emphasis> to the subroutine
+and its value is used several times, start off the subroutine's
+computation with the substitution statement Y = X and use Y instead of
+X everywhere. Only this substitution statement will then need to be
+initialized with the address of X. (2) If the
+<emphasis>address</emphasis> of a variable is needed, as in the case
+of an <emphasis>output</emphasis> argument, or an argument which is an
+array name, one cannot use the method just given in (1). One can
+instead put the variable or array in PROGRAM COMMON by means of
+(identical) declarations in both the main program and the subroutine.
+Then the variable or array should <emphasis>not</emphasis> be used as
+an argument at all, and the initialization is thus avoided. Note that
+in this case (identical) dimension declarations are necessary for such
+arrays in both the main program <emphasis>and the
+subroutine</emphasis>.</para>
+
+<para>(10) A new logical operation is now available in MAD, the
+"exclusive or", written as .EXOR.. The precedence of .EXOR. is the
+same as the precedence of .OR., and its definition is: M .EXOR. N has
+the value 1B if and only if either M or N has the value 1B, but not
+both.</para>
+
+<para>(11) Most diagnostic comments printed for errors in part I of
+the translation now include references to the appropriate section of
+the MAD manual. These references appear in parentheses following the
+comment. For example, (II.1.1.4) refers to Chapter II, section 1.1.4
+which is titled <emphasis>Boolean Constants</emphasis>.</para>
+
+<para>(12) Each use of the subscript notation A(i,j) where A is an m x
+n array, involves evaluation of the expression n(i - 1) + (j - 1) + b
+where n = the number of columns in A and b = the base point, i.e.,
+A(1,1,) ≡ A(b). A method which is <emphasis>much more
+efficient</emphasis> is to preset or compute at the beginning of the
+program, the vector: V(1) = b-1, V(2) = b-1+n, V(3) = b=1+2n, ...,
+V(m) = b-1+(m-1)n. The i<superscript>th</superscript> element in the
+vector is the linear subscript in A of the element in A immediately
+preceding the first element in the i<superscript>th</superscript> row.
+To refer to A(i,j) one now writes A(V(i)+j). The base point and
+number of columns may be changed during computation, but each time
+either is changed the elements of V must be recomputed. The usual
+subscript restrictions still hold, i.e. i ≤ 0, (V(i)+j) ≤ 0. For
+example, if A is a 4 x 3 matrix (m = 4, n = 3) and b = 1, then V(1) =
+0, V(2) = 3, V(3) 6, and V(4) = 9.</para>
+
+</appendix>
</book>
<!--
Local Variables: