From: Eric S. Raymond Date: Wed, 18 Feb 2004 11:34:26 +0000 (+0000) Subject: Inserted pagebreak indications. X-Git-Tag: 1.0~81 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=9747a02abb4f6b4f71fcd61de9772508be23661c;p=mad.git Inserted pagebreak indications. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index eef3f59..08cd898 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -41,7 +41,7 @@ stretched from FORTRAN in 1955 until the rise to dominance of C after assumptions of computing in 1962 and earlier. Some features of MAD are only superficially odd. The all-caps -listings look strange to modern eyes; the IBM 709 on which it was +listings look strange to modern eyes; the IBM 704 on which it was implemented had a pre-ASCII, pre-EBCDIC six-bit character set with no lower-case letters and lacks several punctuation marks that later became standard. The limitation to six characters in variable names, @@ -211,7 +211,7 @@ standard output. Printer control codes +, 1, 2 and 4 are ignored (treated as 0 or space). Tape and drum devices are not supported. -The 709 had 36-bit words; MAD floats are translated to C +The 704 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 @@ -314,6 +314,9 @@ the original style in DocBook. hand-drawn across them). The original also some contained hand-drawn script characters: +Redactor's comments in the body of the text are +decorated like this. + @@ -368,7 +371,7 @@ the original. Notably, "section 1.1" becomes "Section 1.1" EPSLON and COMPLX and the like are not typos. As pointed out earlier, MAD variable names are limited to the 6 characters in a -six-bit character set that would fit in the IBM 709's 36-bit +six-bit character set that would fit in the IBM 704's 36-bit word. A few typos in the original have been fixed; if you're really @@ -586,9 +589,15 @@ THROUGH BACK, FOR ALPHA = 12, 3 ALPHA .G. 90 .OR. .ABS. (X+Y) .LE. EPSLON Here we have substituted ".G." for ">", ".LE." for "≤", ".ABS. (X+Y)" for "|x + y|". (The reason for these simple -substitutions is characters such as >, ≤ as input to the computer. -Such details are fully presented -in Chapter II of this manual.) +substitutions is the lack of characters such as >, ≤ as input to +the computer. Such details are fully presented in +Chapter II of this manual.) + +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. The flow diagram for our previous example, then, may be rewritten as follows: (In order to keep the notation familiar when @@ -737,7 +746,7 @@ the function now need only call upon it by name, as in the statement: LARGEQ = 1. + MAX. (6,Q)/3. -Note that the set (in this use of MAX.) hose largest element is +Note that the set (in this use of MAX.) whose largest element is desired is called Q, and N has the value 6. No DIMENSION statement is needed for A is the EXTERNAL FUNCTION definition program above, since A is there only as a "dummy variable", anyway. When @@ -964,10 +973,11 @@ incrementing of i is not really necessary. - + + + &newton2; @@ -1997,6 +2007,7 @@ instructions. (i.e. function returns). location to be used for temporary storage. Consecutive elements will be used as required by the following statements. + SAVE DATA &scriptL; @@ -2043,6 +2054,7 @@ available for use by successive SAVE statements. + Input-Output Statements In this section the follwing definition the following @@ -2112,6 +2124,7 @@ according to format &scriptF;. WRITE BINARY TAPE &scriptN;, &scriptL; + Transmits &scriptL; to tape &scriptN; in binary form as one record. @@ -2174,7 +2187,7 @@ 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 +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 @@ -2204,9 +2217,9 @@ cancels the previous one. Format Specifications -When information is read from (or punched in) a card into (or from) a -computer, it is necessary to know how this information has been -allocated among the available columns of the card. Similarly, +When information is read from (or punched in) a card into (or +from) a computer, it is necessary to know how this information has +been allocated among the available columns of the card. Similarly, whenever information is to be printed by a printer (either on-line of off-line), it is necessary to know how this information has been allocated among the columns available on the printer. A description @@ -2215,10 +2228,11 @@ always, such a specification is accompanied by a list of variables whose values are to be printed or punched or whose values are to be 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 section 3.7), computed, or read in as data. +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 section 3.7), computed, or read in as +data. Carriage Control @@ -2263,6 +2277,8 @@ move to the next line before printing, as will be seen from the following table. In each case the carriage control character is effective before the rest of the specification is carried out. + + @@ -2321,7 +2337,9 @@ external medium as follows: (For the purposes of input-output the Boolean values 0B, 1B are considered as integers and will be punched in cards and appear in -print as 0, 1.) The integer indicates the size of the field; i.e., +print as 0, 1.) + +The integer indicates the size of the field; i.e., the number of available columns to be used. For example, K3 indicates a 3-column octal field, C23 indicates a 23-column character field, andf S31 indicates a blank field of 31 columns. @@ -2365,6 +2383,7 @@ form (if 5 decimal places are requested, for example): +0.x1x2x3x4x5E±n1 n2 + where n1n2 is the exponent. On input cards numbers in E fields @@ -2417,6 +2436,7 @@ specification is assumed to be in alphabetic (BCD) form both inside the computer and outside. + Repetition of Basic Field Specifications If several consecutive fields can be described by the same basic @@ -2478,6 +2498,7 @@ For E fields , the "scale factor" causes the number itself to be modified, but the exponent is correspondingly modified so the true value of the number remains unchanged . Thus the number 0.9321E-3 would print as 0.9321E-03 + according to the specification E18.4*, but it would print as 93.2100E-05 according to the specification 2PE18.4*. Unlike an F number, the value is the same in either @@ -2526,7 +2547,9 @@ floating point ten column field. Note that blanks are completely ignored throughout all format specifications except when they occur as characters in a Hollerith string. Note also, that while every field specification of types S, I, E, F, K, and C must be followed by -commas, the comma may be omitted after a Hollerith string of the type +commas, the comma may be omitted after a + +Hollerith string of the type described here. The comma may be used, however, if desired. @@ -2580,7 +2603,9 @@ names of variables (in this case, the three variables A(6), A(7), and A(8).) During the transmission of information, the input or output subroutine scans both the list and the specification simultaneously, correlating corresponding entries, and associating a field size, a -type of conversion, etc. to each variable. If a Hollerith string is +type of conversion, etc. to each variable. + +If a Hollerith string is encountered in the specification, it is immediately transmitted, and it is not associated with any item on the "list." @@ -2630,6 +2655,7 @@ similar statement may be made for printed or punched output. 3F10.3 /4(F10.3, 6HBETA = I2)* + the first line printed (or read) would have three fixed point numbers, subsequent lines would all be printed (or read) according to the @@ -2687,6 +2713,7 @@ read and stored until needed. + Declarations (Non-executable statements) @@ -2737,6 +2764,7 @@ different modes. All constants are automatically assigned modes by the translator (see ). Other automatic assignments of modes are: + A name appearing in the statement label field is @@ -2790,7 +2818,9 @@ A(1,1), A(I,J), B(I+6,J/3+3). Although any number of dimension declarations may be used in a program, as many variables as desired may be "declared" in any dimension declaration. The declaration consists of the word -DIMENSION, followed by the variables to be declared. Each variable is +DIMENSION, followed by + +the variables to be declared. Each variable is immediately followed by one or two arguments (separated by a comma) enclosed in parentheses, as follows: @@ -2838,6 +2868,7 @@ respectively. The matrix will be located at various places in the XA region depending on the value of V(1) at the time a reference is made ot a matrix element during execution of the program. Observe that this ability to vary the location of the initial array element (i.e., + the array element with unit indices) within the linear array allows the effective use of negative subscripts - in spite of the fact that the defined ranges of the subscripts are positive. @@ -2926,6 +2957,7 @@ values of a, b, and C are printed immediately after they are brought in to help in finding trouble spots during the development of the program (not as necessary here as in longer problems, but a good idea!). + Flow Diagram: @@ -2934,11 +2966,13 @@ idea!). + The Program: &quadratic; + *DATA 4. -8. 4. 0 5. 10. @@ -3024,6 +3058,7 @@ original table had: The problem is to write a program to generate the entire "truth table" for the given expression T. + Flow Diagram: @@ -3032,6 +3067,7 @@ table" for the given expression T. + The Program: @@ -3053,6 +3089,7 @@ NORMAL MODE IS BOOLEAN instead of the BOOLEAN declaration. + Example 3 Problem: To approximate @@ -3090,6 +3127,7 @@ external function or an internal function. + The Program: @@ -3100,9 +3138,11 @@ external function or an internal function. If, for some reason, the integral of sin 3x - cos(rx + 1) were needed if 0 ≤ x ≤ 3, and the integral of sin 3x - cos(rx) otherwise, the program might then be as follows: + The Program: + &simpsmain; @@ -3115,7 +3155,7 @@ otherwise, the program might then be as follows: 0 2. 10 10. -An alternate way tio write the first eight lines of this +An alternate way to write the first eight lines of this program, illustrating one use of the FUNCTION NAME mode, would be: @@ -3131,6 +3171,7 @@ READ READ FORMAT INPUTS,A,B,N,R TRANSFER TO READ FUNCTION NAME S +