From: Eric S. Raymond Date: Thu, 22 Apr 2004 10:10:32 +0000 (+0000) Subject: A few more pages. X-Git-Tag: 1.0~27 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=ee7e1e2064b17a620e8d428176bc4909b907cc1b;p=mad.git A few more pages. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index fff13ee..1cff6f7 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -4852,9 +4852,156 @@ the use of tape 6 (the output tape) is implied. The PRINT FORMAT ... statement produces a call for this subroutine. + +TAPERD +Entry to this subroutine causes BCD information to be +read from tape. The arguments are: (1) location of the format +specification, (2) tape number, and (3) a list of variable to be read. +The READ BCD TAPE . . . statement produces a call for this +routine. + + + +READ +Similar to TAPERD above except that the use of tape 7 (the input tape) is implied. The READ FORMAT . . . statement +produces a call for this subroutine. + + + +PUNCH +Entry to this subroutine causes BCD information to be +written on tape 5 (punch output type). +The arguments are the same as PRINT and the PUNCH FORMAT +. . . statement produces the call. + + + +COMMNT +Entry to this subroutine causes +BCD informtion to be printed on the attached (on-line) printer. The +arguments are the same as PRINT except that the line spacing is not +given in the format specification since an automatic 1/6 page skip is +produced. The statement producing the call is PRINT ON LINE +. . . . + + + +SETEOF +This name may appear explicitly in the form +SETEOF.(S). where S is an expression in the statement label mode +designating the point of return when an end-of-tape is encountered +during the reading or the writing of magnetic tape. + + + +SETETT +This name may appear explicitly in the form +SETETT.(S). where S is an expression in the statement label mode +designating the point of return when an end-of-tape is encountered +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. + + + +It should be understood thatthe subroutines described above may be called by other subroutines as well as statements. Thus, for example, +SETEOF is called by TAPERD, TAPEWR calls PRINT, and all of the +input-output routines call ERROR. + +The DEFINE Statement in MAD + +DEFINE is not supported in the Retrocomputing Museum +implementation. + +The following describes a procedure by which new operators and +mode conversion operations may be introduced into the MAD language and +used immediately thereafter in the rest of the program. As each +definition is processed, the sequence of machine-like operations +defining the behavior of the operator becomes part of the translator, +just as the sequence for any already existing operator in the MAD +language. The definition is "temporary", in that it applies only the +program or external function definition which contains the definition +program. In every case, the definition program must precede the first +use of the operator or conversion being defined. A definition may +refer to previously defined operators and conversions, but not to +operators or conversions not yet defined. An example is given +immediately below, to which reference may be made while reading the +complete explanation which follows it. + + + Example: + + DEFINE BINARY OPERATOR .LOGADD., PREDECENCE SAME AS .OR. + MODE STRUCTURE 2 .LOGADD.2 TO 2, 1 .LOGADD.1 TO 1 + + + JMP *+1, MQ, *+7 + STQ T + CAL A + ORA B + SLW T+1 + CLA T+1 + OUT AC + STO T + JMP *-6 + END + + +This example illustrates some, but not all, of the pertinent facts about definitions. + +Operator name + +The name of the operator being defined consists of a sequence of +letters (at most six), preceded and followed by +periods (e.g. .LOGADD.). + + +Modes + +The modes already existing in MAD are referred to in operator +and conversion definition programs by numeric codes: + + + Floating Point 0 + Integer 1 + Boolean 2 + Function Name 3 + Statement Label 4 + + +The user may find it necessary to introduce new modes to accompany +newly defined operators. These are introduced via mode declarations +similar to those of the form + +INTEGER J,M,P,GCD.,E + +except that the new modes are designated by number, as, for +example, + +MODE NUMBER 5 MP, GR, V., T + +The available numbers are 5, 6, and 7, and these may represent any +modes desired. This mode declaration does not carry any information +as to the nature of the arithmetic implied by the mode; it merely +declares certain variables and function values to be of that mode. +The interpretation of the mode is implicit in the operator and +conversion definition programs. Mode declarations may occur anywhere, +as before, except within operator and conversion definition programs. + + + + +