From: Eric S. Raymond Date: Wed, 18 Feb 2004 06:22:44 +0000 (+0000) Subject: Added crossrefs. X-Git-Tag: 1.0~91 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=4acb464c612351880619555f6a80e72b1068e6f6;p=mad.git Added crossrefs. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index 54326aa..154aac4 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -154,8 +154,9 @@ pass-by-reference, and given that all variables are global it is difficult to imagine code that would. Label arrays, array-mode variables, and the associated -computed-transfer statement are not implemented. Neither are multiple -ENTRY points, or TAPE and DRUM statements. +computed-transfer statement are not implemented (mainly because the +manual did not include programs with which they could be tested). +Neither are multiple ENTRY points, or TAPE and DRUM statements. Only the no-argument case of ERROR RETURN is supported. The language describing the more general case of this feature is deeply @@ -202,8 +203,9 @@ typewriters of the period did not have. This distinction has been added in the present text. Some program listings in the original were missing continuation -punches required by the language. These have been corrected, and the -corrections noted in XML coments. +punches that appear to be required by the language; this was probably +due to transcription errors in the original. These have been +corrected, and the corrections noted in XML comments. Most of the original listings were typed so there was whitespace between remark or continuation punches and following statements or @@ -1004,25 +1006,27 @@ internally as $ABCD□□$ 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 section 3.3) 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 subscripts separated by commas and enclosed in -parentheses. Thus the following are "single variables:": X51, ALPHA6, -LAMBDA, GROSS, while the following are elements of arrays: BETA(C1, -C2, 6), X15(Y, Z1), J(6), J(Z1 + 5 *Z2, 5). (See for the description of subscripts.) Parentheses -enclosing subscripts may not be omitted. +n-dimensional array variable (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 +subscripts separated by commas and enclosed in parentheses. Thus the +following are "single variables:": X51, ALPHA6, LAMBDA, GROSS, while +the following are elements of arrays: BETA(C1, C2, 6), X15(Y, Z1), +J(6), J(Z1 + 5 *Z2, 5). (See for the +description of subscripts.) Parentheses enclosing subscripts may not +be omitted. -Statement Labels A statement may be -labelled or unlabelled. Labels are used to refer to a statement in -other statements. A statement label consists of from one to six -letters or digits, the first of which must be a letter, e.g. IN or -BACK. A statement label may be an element of a statement label -vector, in which case the vector name is followed by a +Statement Labels + +A statement may be labelled or unlabelled. Labels are used to +refer to a statement in other statements. A statement label consists +of from one to six letters or digits, the first of which must be a +letter, e.g. IN or BACK. A statement label may be an element of a +statement label vector, in which case the vector name is followed by a constant integer subscript enclosed in parentheses, e.g. S(2) or LBL(3). A statement label appears in the label field (i.e. columns 1-10) of the statement it identifies. When @@ -1133,7 +1137,7 @@ usual logical operations, ~, ∨, ∧, ⊃, and ≡. Boolean constants, Boolean individual variables, Boolean subscripted array variables and Boolean-valued functions are Boolean expressions. (see and -section 3.2). +). If H and F are arithmetic expressions: then H.L.F., H.LE.F, H.E.F., H.NE.F, H.G.F., H.GE.F, are Boolean @@ -1219,8 +1223,8 @@ function value is determined by its mode. There are five modes in MAD; floating point, integer, Boolean, statement label, and function name. Floating point, integer, and Boolean constants were described in . Alphabetic constants are assumed to -be of integer mode. Section 3.2 describes how the modes of variables -and functions are specified. +be of integer mode. describes how +the modes of variables and functions are specified. If an expression consists entirely of one constant, one variable, or one function value, the mode is that of the constant, @@ -1688,7 +1692,8 @@ used for incrementing, testing, etc. POLY Y = X * Y + C(J) -(For the meaning of the statement INTEGER J,N see section 3.2). +(For the meaning of the statement INTEGER J,N see ). (ii) A Newton's Method solution (Xk+1 = xk - @@ -1834,7 +1839,7 @@ and parentheses may be omitted in an EXECUTE statement if the function has no arguments. -Error Return Statement +Error Return Statement Provision is made for including an error return in function definition programs (see section 3.8). The form of the statement is @@ -1964,23 +1969,24 @@ available for use by successive SAVE statements. 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(ii, -..., in) ... A(ji, -...jn) 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 Restrictions below). +specification vector (see ) 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(ii, ..., in) +... A(ji, ...jn) 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 +Restrictions below). @@ -2117,7 +2123,8 @@ specified by the latest execution of SETETT.), i.e., each setting cancels the previous one. -FORMAT SPECIFICATIONS +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 @@ -2135,7 +2142,7 @@ 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 +Carriage Control Every format specification consists of a description of the allocation of available columns, and the form in which the particular information @@ -2148,8 +2155,8 @@ proper computer hardware configuration is available. The use of 72 columns is always safe, however, and strongly recommended. while a line of print has 120 available columns. Any attempt to allocate more than the available -number of columns will cause an error return (see section -2.14.1). +number of columns will cause an error return (see ). (b) The first columnof a card has no special significance. The first (left-most) character of a line of print is treated differently. This @@ -2209,12 +2216,13 @@ off-line), and not at all to cards. The Basic Field Description -Each specification describes successive fields across the available -columns, starting fromthe left. If the specification describes fewer -than the total number of available columns, the line (or card) will -automatically be filled in with blanks. But, as indicated above, if -more than the total number of available columns is included in the -specification, an error return (see section 2.14.1) will result. +Each specification describes successive fields across the +available columns, starting fromthe left. If the specification +describes fewer than the total number of available columns, the line +(or card) will automatically be filled in with blanks. But, as +indicated above, if more than the total number of available columns is +included in the specification, an error return (see ) will result. The basic field description consists of a letter followed by an integer. The letter indicates the form of the information in the @@ -2331,7 +2339,7 @@ specification is assumed to be in alphabetic (BCD) form both inside the computer and outside. -Repetition of Basic Field Specifications +Repetition of Basic Field Specifications If several consecutive fields can be described by the same basic specification, reptition may be avoided by prefixing the basic @@ -2400,26 +2408,26 @@ case. Multiple Specifications -Several specifications may be condensed into one larger one by the use -of the character "/". Each appearance of "/" (except as part of a -Hollerith field-see section 2.15.8) indicates that the specification -of a new line (or card) is to be started with what follows. A pair -"//" causes a blank line (or card), three "///" cause two blank lines -(or cards), etc. Thus, the specification +Several specifications may be condensed into one larger one by +the use of the character "/". Each appearance of "/" (except as part +of a Hollerith field-see ) indicates +that the specification of a new line (or card) is to be started with +what follows. A pair "//" causes a blank line (or card), three "///" +cause two blank lines (or cards), etc. Thus, the specification 3F10.3/I2, K18, 2C5/7I3* -implies that one line (or card) is described by the specification -3F10.3, and the next line (or card) is described by the specification -I2,K18,2C5, and the next by 7I3. It must be noted that each line (if -printing is being described) is described individually here, and must - include its own carriage control (see section -2.15.1). +implies that one line (or card) is described by the +specification 3F10.3, and the next line (or card) is described by the +specification I2,K18,2C5, and the next by 7I3. It must be noted that +each line (if printing is being described) is described individually +here, and must include its own carriage control +(see ). -Hollerith fields +Hollerith fields Although the C specification is available for transmitting characters (Hollerith information) to and from storage, it is often @@ -2484,19 +2492,19 @@ storage). Relationship between the List and the Specification -The "list" consists of a set of names of variables to or from which -information is to flow. Except for Hollerith strings imbedded in the -format specification itself (see section 2.15.8) and the S fields, -each field in the specification refers to one item on the list. For -this purpose, a regional entry on the list, such as A(6) ...A(8), -counts as several 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 encountered in the specification, -it is immediately transmitted, and it is not associated with any item -on the "list." +The "list" consists of a set of names of variables to or from +which information is to flow. Except for Hollerith strings imbedded +in the format specification itself (see ) and the S fields, each field in the +specification refers to one item on the list. For this purpose, a +regional entry on the list, such as A(6) ...A(8), counts as several +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 +encountered in the specification, it is immediately transmitted, and +it is not associated with any item on the "list." For example, if the list consisted of: @@ -2534,7 +2542,7 @@ specification (the *) until it hits a left parenthesis not in an H field. (If there is no left parenthesis, it will move to the beginning of the specification). It then examines the characters just to the left of this left parenthesis to see if they are a multiplicity -indication (see section 2.15.5). From this left parenthesis (together +indication (see ). From this left parenthesis (together with the multiplicity, if any) to the end of the specification now becomes the format specification until the list is satisfied. A similar statement may be made for printed or punched output. @@ -2620,7 +2628,7 @@ program. Every card of the remark declaration must have an "R" in column 11. -Mode Declaration +Mode Declaration All variables and function values are assumed to have the normal mode unless declared otherwise. Any of the other modes may be specified as @@ -2649,18 +2657,20 @@ of such mode declarations but a name may not be declared to be of two different modes. All constants are automatically assigned modes by the translator -(see section 1.1). Other automatic assignments of modes are: +(see ). Other automatic assignments of +modes are: -A name appearing in the statement label field is assigned -statement label mode (see section 1.3). +A name appearing in the statement label field is +assigned statement label mode (see ). A function name constant is assigned function name mode (see -section 1.4). +). A vector appearing as the dimension vector of some -array in a dimension declaration is assigned integer mode (see section -3.3). +array in a dimension declaration is assigned integer mode (see ). A vector which is preset by a vector values declaration is assigned a mode consistent with the assigned values (see section 3.7). @@ -2668,7 +2678,7 @@ assigned a mode consistent with the assigned values (see section 3.7). -Dimension Declaration +Dimension Declaration Variables may be declared to be array variables, such as vectors or matrices of various dimensions, rather than individual variables. @@ -2712,17 +2722,18 @@ assume during the execution of the program. The size of the region allocated is this number plus one, regardless of whether the program actually makes use of this amount or not. -The second argument, given only for arrays with dimension n > 1, is -the name of the first element in the "dimension vector" for this +The second argument, given only for arrays with dimension n > 1, +is the name of the first element in the "dimension vector" for this array. If this name is D(k) (k must be an integer constant), the vactor D is automatically assigned integer mode. D may not be declared to be other than integer. In addition, D must itself be dimensioned, either by declaration or by presetting its values -(section 3.7) to have its largest linear subscript # k+n. Assuming +(section 3.7) to have its largest linear subscript ≤ k+n. Assuming that elements of the array to be dimensioned are to be referred to as -A(I1, I2, In), the elements of the linear array D, i.e. D(k), D(k + -1), ...D(k + n), must be preset (or set during computation) to the -values +A(I1, I2, +In), the elements of the linear array D, +i.e. D(k), D(k + 1), ...D(k + n), must be preset (or set during +computation) to the values D(k) = n @@ -2770,11 +2781,12 @@ subscripts are not available for vectors. Dimensioning is automatic in two situations -(a) In case a statement label vector, say L, is used (see section 1.3) -and n is the highest subscript used on L in the statement label field -(i.e., if L(m) appears then m # n), then n + 1 locations are reserved -for L. L may also appear in a dimension declaration in which case the -highest linear subscript is used. +(a) In case a statement label vector, say L, is used (see ) and n is the highest subscript used on L +in the statement label field (i.e., if L(m) appears then m ≤ n), +then n + 1 locations are reserved for L. L may also appear in a +dimension declaration in which case the highest linear subscript is +used. (b) If part of all of a linear array is set by a VECTOR VALUES declaration the array need not appear in a dimension statement unless