From: Eric S. Raymond Date: Sun, 20 Jun 2004 04:57:51 +0000 (+0000) Subject: Page numbers all through, index entries up to asterisk. X-Git-Tag: 1.0~20 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=ff72fa2be623424c419219e1182374d9d9565657;p=mad.git Page numbers all through, index entries up to asterisk. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index 5c9dfab..0487e86 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -510,6 +510,7 @@ University of Michigan students and staff. In order to present a problem to a digital computer for solution, it is necessary to transmit to the machine a statement of the problem, a procedure for solving it (usually called an algorithm +Algorithm for the solution of that problem), and the data which is needed in the solution. In fact, a statement of the problem is not really necessary, since the algorithm and data are sufficent for a computer, @@ -970,21 +971,21 @@ format description also causes the printing of some constant alphabetic information preceding thenumber; namely, the remark "A TOO SMALL, A = ". -The next two statements following the last TRANSFER TO ST -set the initial values of two vectors named ALPHA and BETA. -Although VECTOR VALUES statements can be used to preset -vectors to specified numeric values, in both instances here -the values are format descriptions. The -strings of characters between the dollar signs (MAD quotation -marks!) are to be taken literally as they appear and stored in -designated vectors. The actual format specifications are -described in more detail in Chapter II, but, for example, the -first description: S1,3F15.6* means that the first item is to -be a space (S1), followed by three (3) numbers printed with a -decimal point but no exponent (F), each occupying fifteen card -or print positions (15), and that there will be six positions -to the right of the decimal point (.6). The asterisk (*) -indicates the termination of the description. +The next two statements following the last TRANSFER TO +ST set the initial values of two vectors named ALPHA and BETA. +Although VECTOR VALUES statements can be used to preset vectors to +specified numeric values, in both instances here the values are +format descriptions. The strings of characters +between the dollar signs (MAD quotation marks!) are to be taken +literally as they appear and stored in designated vectors. The actual +format specifications are described in more detail in Chapter II, but, +for example, the first description: S1,3F15.6* means that the first +item is to be a space (S1), followed by three (3) numbers printed with +a decimal point but no exponent (F), each occupying fifteen card or +print positions (15), and that there will be six positions to the +right of the decimal point (.6). The asterisk +(*)Asterisk indicates the +termination of the description. The final statement indicates the end of the statements and is the last statement executed when a definite termination @@ -1158,20 +1159,22 @@ constants with exponent are; "-" sign. Positive constants may be preceded by a "+" sign. -Alphabetic Constants -An alphabetic consists of from one to six admissible -characters preceded and followed by the character "$". The admiss- -ible characters include all letters of the alphabet, the digits 0 -through 9, the special characters +, -(minus sign), -(dash), *, -/, =, ). (. ., the comma "," and the blank space, 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, 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 to six -characters by adding blanks on the right; thus $ABCD$ will appear -internally as $ABCD□□$ +Alphabetic Constants An alphabetic +constantAlphabetic Constants +consists of from one to six admissible +charactersAdmissible +Characters preceded and followed by the +character "$". The admiss- ible characters include all letters of the +alphabet, the digits 0 through 9, the special characters +, -(minus +sign), -(dash), *, /, =, ). (. ., the comma "," and the blank space, +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, 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 to six characters by adding blanks on the right; thus +$ABCD$ will appear internally as $ABCD□□$ The Retrocomputing Museum implementation neither enforces @@ -1189,7 +1192,8 @@ machine word. The name of a variable consists of one to six letters or digits, the first of which must be a letter. If the variable is defined as an -n-dimensional array variable (see Array +Variables (see ) then the name of an element of the array consists of the variable name, (i.e one to six letters or digits, starting with a letter), followed by the appropriate @@ -1232,10 +1236,13 @@ and COS. (X) are values of functions. Arithmetic Operations -The following arithmetic operations are available: +The following arithmetic +operationsArithmetic +Operattions are available: -Addition, written as "+", e.g., Z5 + D. +Addition, written as "+", e.g., Z5 + D. +Addition Subtraction, written as "-", e.g., Z5 - D. (Note, both the minus sign and the dash are accepted.) @@ -1266,7 +1273,9 @@ means -(X-.5). Arithmetic Expressions -Arithmetic expressions are defined inductively as follows: +Arithmetic expressionsArithmetic +Expressions are defined inductively as +follows: All integer, floating point, and alphabetic constants, @@ -1277,7 +1286,8 @@ values of functions are arithmetic expressions. If E and F are any arithmetic expressions and V and individual or subscripted array variable, then the following are also arithmetic expressions: +E, -E, .ABS.E, E + F, E - F, -E * F, E/F, E.P.F, and (E). +E * F, E/F, E.P.F, and (E)..ABS. +Absolute Value The only arithmetic expressions are those arising in (a) and (b). @@ -1298,7 +1308,8 @@ language (where M and P are boolean expressions): have the value 0B. M.AND.P has the value 1B if and only if both M and P -have the value 1B. +have the value 1B. +.AND. M.THEN.P has the value 0B if and only if M has the value 1B and P has the value 0B. @@ -2354,10 +2365,11 @@ read. (Occasionally, the information is contined entirely in the format specification, so the list may be empty.) A format specification is a string of alphabetic characters (as -described below) terminated by an "*". This string is stored six -characters per computer word in a vector with integer mode. This -vector may be preset (see ), computed, -or read in as data. +described below) terminated by an "*"Array +Variables. This string is stored six characters +per computer word in a vector with integer mode. This vector may be +preset (see ), computed, or read in as +data. Carriage Control @@ -2921,7 +2933,8 @@ linkend='statement_labels'/>). ). A vector appearing as the dimension vector of some -array in a dimension declaration is assigned integer mode (see Array Variables in a +dimension declaration is assigned integer mode (see ). A vector which is preset by a vector values @@ -3076,7 +3089,8 @@ not have the same mode. The mode must be established by the appropriate MODE declaration for each of the variables. Occurrences within an EQUIVALENCE declaration do not establish mode. -A nonsubscripted array variable name in an EQUIVALENCE statement +A nonsubscripted array variableArray +Variables name in an EQUIVALENCE statement represents that element of the array (considered as a one-dimensional vector) whose subscript is zero. Reference in an EQUIVALENCE statement to an array element of any number of dimensions may be made @@ -3251,26 +3265,26 @@ III. External Function Definitions - -These statements define functions not yet available in the -language or as standard package programs ("subroutines"). The -designatyion "EXTERNAL" implies that the statements which follow are -to be translated indpendently of the main program in which they are to -be used. (Because of this independence this block of statements is to -be considered an entirely separate program, and must have its own -DIMENSION and MODE declaration, etc.) The word "EXTERNAL" also -implies that occurrences of variables and functions in the current -function definition program have no relation whatever with occurrences -of similarly named variables and functions in the main program -(or other definition programs), and no difficulties will be -encountered because of the use of similar names. The modes of the -arguments (if other than the normal mode), must be declared in the -usual way (see ), but arrays which -are arguments need not be dimensioned. + These statements define functions not yet +available in the language or as standard package programs +("subroutines"). The designation "EXTERNAL" implies that the +statements which follow are to be translated indpendently of the main +program in which they are to be used. (Because of this independence +this block of statements is to be considered an entirely separate +program, and must have its own DIMENSION and MODE declaration, etc.) +The word "EXTERNAL" also implies that occurrences of variables and +functions in the current function definition program have no relation +whatever with occurrences of similarly named variables and functions +in the main program (or other definition programs), and no +difficulties will be encountered because of the use of similar names. +The modes of the arguments (if other than the normal mode), must be +declared in the usual way (see ), +but arraysArray Variables +which are arguments need not be +dimensioned.Arguments of +Functions Internal Function Definitions @@ -3288,8 +3302,9 @@ variables and functions will be used. Names of variables and functions which occur as arguments of the function being defined are designated "dummy arguments" (or "bound variables"). They must be distinct from those appearing elsewhere in the program. The modes of -dummy arguments (if other than normal mode) must de declared in the -usual way, but arrays which are arguments need not be +dummy arguments (if other than normal mode) must be declared in the +usual way, but arraysArray +Variables which are arguments need not be dimensioned. One form of internal function definition (not available as an external @@ -3462,11 +3477,12 @@ follows.) The list of dummy variables in the declaration statement itself (statement A in the preceding paragraph) may contain only -nonsubscripted variable names (either individual or array) or function -names (without arguments). Within the definition program itself (the -statements between statement A and statement B), a function name will -usually occur with arguments, and an array variable will usually occur -with subscripts. +nonsubscripted variable names (either individual or +array)Array Variables or +function names (without arguments). Within the definition program +itself (the statements between statement A and statement B), a +function name will usually occur with arguments, and an array variable +will usually occur with subscripts. A few comments about the last example. This definition program defines a single-valued function of X, called INVSF.. Since no mode @@ -4394,6 +4410,7 @@ file. Example 4<emphasis role='note'>: Actuarial computation</emphasis> +Actuarial Example Problem: Computation of actuarial commutation columns based on an arbitrary set of mortality rates and an interest @@ -4905,9 +4922,10 @@ during the reading or the writing of magnetic tape. SETERR This name may appear explicitly in the form SETERR.(S), where S is an expression in statement label mode -designating a point of return after an illegal data character or -illegal format specification has been encounterered by an input-output -subroutine. +designating a point of return after an illegal data + +character or illegal format specification has been encounterered by an +input-output subroutine. @@ -4918,6 +4936,7 @@ input-output routines call ERROR. + The DEFINE Statement in MAD DEFINE is not supported in the Retrocomputing Museum @@ -4966,6 +4985,7 @@ complete explanation which follows it. periods (e.g. .LOGADD.). + Modes The modes already existing in MAD are referred to in operator @@ -5010,16 +5030,18 @@ as before, except within operator and conversion definition programs. where .NAME. is the name of the operator being defined (the operator -may be either binary or unary), and .OPER. is the name or symbol of -some exist­ing or previously defined operator. This statement -establishes the precedence (relative to the missing-parenthesis -convention) of the operator .NAME. as being (1) immediately above that -of .OPER. (but below all those already above .OPER.), (2) equal to -that of .OPER., or (3) immediately below that of .OPER. (but above all -those already below .OPER.). The name .OPER. could also be a single -character, such as *, +(binary), -(binary), or /. Unary minus can be -referred to in such statements by the name -U. Unary plus should not -be used. +may be either binary or unary), and .OPER. +is the name or symbol of some exist­ing or previously defined +operator. This statement establishes the precedence (relative to the +missing-parenthesis convention) of the operator .NAME. as being (1) +immediately above that of .OPER. (but below all those already above +.OPER.), (2) equal to that of .OPER., or (3) immediately below that of +.OPER. + +(but above all those already below .OPER.). The name .OPER. could also +be a single character, such as *, +(binary), -(binary), or /. Unary +minus can be referred to in such statements by the name -U. Unary +plus should not be used. The MODE STRUCTURE STATEMENT @@ -5061,6 +5083,7 @@ will be made below to schemes of "type 1" and "type 2" as indicated above, and to the M and N contexts and the mode number r which appear in these schemes. + After the DEFINE statement (but not necessarily immediately after) must be one or more sequence definition programs. Each of these programs consists of one MODE @@ -5104,6 +5127,8 @@ programs: MAD language or appear in the M position in another MODE STRUCTURE statement. + + (2) Every context appearing in the program containing the definition program must appear in an M position in some MODE STRUCTURE statement. This applies in particular to contexts occurring in N @@ -5154,6 +5179,7 @@ illustrated in the example by the instruction JMP *+1, MQ, *+7 + This refers to the symbol MQ, which is one of four logical propositions: @@ -5239,6 +5265,7 @@ operation must be stored if not used. This temporary may not be used for any other purpose. + T + integer constant - @@ -5297,7 +5324,7 @@ sequence.) multiplication if it were not already in the MAD language. The three sequence definition programs define floating point multiplication and two conversions, respectively. - + DEFINE BINARY OPERATOR .FMPY., PRECEDENCE SAME AS *( MODE STRUCTURE 0 .FMPY.0 TO 0 @@ -5345,7 +5372,7 @@ FAD CF OUT AC END - + (2) The unary operator .SHIFT., which shifts an integer in the address part into the decrement part of a word, would be defined as follows (where mode 5 indicates an integer in the decrement part of @@ -5396,7 +5423,7 @@ END program reference (LOC) is the operator .BIT., a Boolean binary operator whose value is 1B if A has a 1 in bit position B, and 0B otherwise. (Bits are numbered here from the left, 0-35.) - + DEFINE BINARY OPERATOR .BIT., PRECEDENCE SAME AS .E. @@ -5442,6 +5469,7 @@ the rest of the instruction in (or after) column 12. Blanks are ignored throughout, except in operating codes. + Operation Codes @@ -5487,7 +5515,7 @@ LBT - + Simplified Input-Output Statements (a) READ DATA @@ -5539,6 +5567,7 @@ 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. + As an example illustrating many of the features described herein consider the data card set: @@ -5606,7 +5635,7 @@ simply preceded by ... . Supplement to the MAD Manual - + November 15, 1960 The notes which appear below describe several new features which have @@ -5646,13 +5675,15 @@ code for that mode. The digit codes are: The new modes 5, 6, and 7, which may be defined as described in the Appendix, may also be used. The constant is converted as usual, 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. +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. (4) A subroutine is not available, called ZERO., which will accept as arguments single variables or blocks (i.e., an "input list") @@ -5687,10 +5718,12 @@ 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 linear subscript 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)) +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)) @@ -5731,11 +5764,13 @@ 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. + + 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 +but considered to be in trans­posed 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). @@ -5777,6 +5812,7 @@ 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. + Thus, if one were testing for values of X between 0 and 2 and between 5 and 6, one might write @@ -5821,7 +5857,7 @@ subroutine. 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. - + (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 @@ -5844,7 +5880,10 @@ 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. + +ArrayVector +