|
|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 155904 (0x26100)
Types: TextFile
Names: »ftnpass53tx «
└─⟦01e83a425⟧ Bits:30008166 Bånd med SW8010 og SW8500 source code
└─⟦75ff9bef3⟧
└─⟦this⟧ »ftnpass53tx «
; fortran, pass 5, page 1
; jørgen lindballe
; c o n t e n t s
;
;
;
; 1 introduction
;
; 2 input
;
; 3 output
;
; 4 process
;
;
; 4.0 general process description
;
; 4.1 label numbers and error labels
;
; 4.2 reverse processing
;
; 4.2.1 macroscopic reverse processing
;
; 4.2.2 microscopic reverse processing
;
; 4.2.2.1 do statement
;
; 4.2.2.2 implied do loop
;
; 4.2.2.3 data statement
;
; 4.2.2.4 parentheses and the stack
;
; 4.3 input - and output records
;
; 4.4 trouble records and error messages
;
;
; 5 the program
;
;
;
\f
; fortran, pass 5, page 2
; chapter 1: introduction
;
;
; the purpose of pass 5 is to:
;
;
; 1. replace labels by labelnumbers and to detect
; erroneous usage of labels and
;
;
; 2. perform such macroscopic and microscopic processing,
; which can be done by a reserve pass only.
;
;
; erroneous used labels are multiple declared labels and
; not declared labels.
;
;
; macroscopic reverse processing is processing which takes
; place over more than one statement, for example the
; creation of the global entry point list, the transport to
; the declaration part of the
;
; label variable list, and
; local entry point list
;
; and the transport to the beginning of a program unit of the
;
; no. of bytes for simple local variables and stm.fct.param.
; external list,
; zone common list, and
; general common list
;
; furthermore macroscopic processing is the picking-up of external
; representations for the global entry point list, the external list,
; the zone common list, and the general common list, and
; finally the replacement of each erroneous terminated do-
; statement by a troublestatement.
;
;
; microscopic reverse processing is processing which takes
; place within a statement, for example the matching
; of left parentheses to their corresponding right paren-
; theses, including the removal of io-parentheses, the
; replacement of <goto> by <simple goto>, <assigned goto>,
; or <computed goto>, the replacement of <end if expression>
; by <arithmetical if> or <logical if>, in troublestatements
; the replacement of operands by <vanished operand> and
; the removal of operators, the processing of do-statements,
; implied do-loops and the pairing of constants and
; variables in data-statements.
;
\f
; fortran, pass 5, page 3
; chapter 2: input
;
;
;
;
; 1 *
; <pass 5 input> ::= (<trouble>) (<unit element>) <end pass>
; 0 1
;
;
;
; <unit element> ::= <end unit>
; <no.of bytes for loc.arrays and loc.zones>
; <no.of bytes for simple loc.var.and stm.fct.par.>
; <label variable list>
; <external list>
; <local entry point list>
; *
; (<statement>)
; 0
; *
; (<statement function declaration>)
; 0
; <common variables in datastatements>
; *
; (<common zone declaration> )
; (<common array declaration>)
; 0
; <zone common list>
; *
; (<trouble>)
; 0
; <general common list>
; *
; (<trouble>)
; 0
; *
; (<local zone declaration> )
; (<local array declaration> )
; 0
; <end formal declarations>
; *
; (<extern. zone declaration>)
; (<formal zone declaration> )
; (<formal array declaration>)
; 0
; <end declarations>
; *
; (<data statement> )
; (<format statement> )
; (<trouble statement>)
; (<empty statement> )
; (<external ident.> )
; 0
; <begin unit>
\f
; fortran, pass 5, page 4
; <statement> ::= <var. assignm. statement> or
; <assign statement> or
; <simple goto statement> or
; <assigned goto statement> or
; <computed goto statement> or
; <call statement> or
; <logical if statement> or
; <arithmetical if statement> or
; <do statement> or
; <entry statement> or
; <return statement> or
; <stop statement> or
; <inout statement> or
; <format statement> or
; <trouble statement> or
; <empty statement>
;
;
; these elements together with
;
; <correct do termination> and
; <erroneous do termination>
;
; which may occur among the statements, are further
; described in the appendix. they are all composed of the
; belowmentioned records.
;
; it is noticed that the <end line> - record, like the
; <external identification> - record, may occur everywhere
; within a programunit, and that format statements and
; trouble statements may occur in the executable part
; as well as in the declarative part of a unit.
;
\f
; fortran, pass 5, page 5
; base input no.of action
; value record bytes
;
;
; 1 not used
; .
; 34 entry 1 0
;
; 35 data group separator 1 37
;
; 36 return 1 0
;
; 37 end unit 1 7
;
; 38 end pass 1 6
;
; 39 begin unit 1 8
;
; 40 end line 1 2
;
; 41 end statement 1 3
;
; 42 begin list 1 23
;
; 43 end list 2 20
;
; 44 call 1 23
;
; 45 logical constant 2 1
;
; 46 integer constant 3 1
;
; 47 real constant 5 1
; long constant
;
; 49 double constant 9 1
; complex constant
;
; 51 statement label 3 15
;
; 52 format label 3 14
;
; 53 label declaration 3 5
;
; 54 end format 3 0
; continue format
;
; 56 external identificat v 4
;
; 57 trouble 4 39
;
\f
; fortran, pass 5, page 6
; 58 end declarations 1 7
;
; 59 end formal decl. 1 7
;
; 60 dya plus 1 0
;
; 61 not used
;
; 62 dyaminus 1 0
;
; 63 not used
;
; 64 mult star 1 0
; div slash
; expon
; .shift.
; listcom
;
; 69 iocom 1 33
;
; 70 impl.init.const. 1 53
; impl.init.var.
;
; 72 impl.init.gen. 1 55
;
; 73 impl.unt.const. 1 49
; impl.unt.var.
;
; 75 impl.unt.gen. 1 51
;
; 76 impl.step const. 1 46
; impl.step var.
;
; 78 impl.step gen. 1 47
;
; 79 do init. const. 1 52
; do init. var.
;
; 81 do init.gen. 1 54
;
; 82 do unt.const. 1 48
; do unt.var.
;
; 84 do unt.gen 1 50
;
; 85 do step.const. 1 46
; do step.var.
;
; 87 do step gen 1 47
;
; 88 data star 1 0
;
; 89 data slash 1 36
;
\f
; fortran, pass 5, page 7
; 90 multiple equal 1 0
;
; 91 impl.equal 1 57
;
; 92 do equal 1 56
;
; 93 arithm. equal 1 0
; .lt.
; .le.
; .eq.
; .ge.
; .gt.
; .ne.
; .and.
; .or.
; .not.
;
; 103 begin closed format 3 18
; begin open format
;
; 105 not used
;
; 106 goto 1 24
;
; 107 if 1 0
; do
; to
; stop
;
; 111 read 1 23
; write
;
; 113 correct do term. 1 16
;
; 114 errorn. do term. 1 17
;
; 115 arithm. left parent. 1 22
;
; 116 end call 1 25
;
; 117 spark 1 0
;
; 118 arithm.right parent. 1 19
;
; 119 io right parent. 1 21
;
; 120 impl. right parent. 1 19
;
; 121 end if-expr. 1 24
;
; 122 vanished operand 1 40
;
\f
; fortran, pass 5, page 8
; 123 end simple goto 1 21
; end comp. goto
; end ass. goto
; end arithm if
; end logical if
;
; 128 end data 1 34
;
; 129 end do 1 41
;
; 130 end io 1 42
;
; 131 not used
; not used
;
; 150 gen.common list v 13
;
; 151 zone common list v 12
;
; 152 com.var.in data stm. 1 (3) 11
;
; 153 local entry point list v 10
;
; 154 external list v 9
;
; 155 label variable list v 44
;
; 156 no.of bytes,s.l.v.,stm.f.par2 43
;
; 157 no.of bytes,loc.arr.,zones3 7
;
;
; 158 loc.arr.declaration 4 7
; com.arr.declaration
;
; 160 form.arr.declaration v 7
;
; 161 loc.zone declaration 9 7
;
; 162 com.zone declaration 4 7
;
; 163 form.zone declar. 5 7
;
; 164 not used
; not used
;
; 169 ext. zone decl. 3 7
;
; 170 not used
; not used
;
\f
; fortran, pass 5, page 9
; 178-185 simple local 2 1
;
; 186-193 simple common 3 1
;
; 194-201 simple param. 2 1
;
; 202-209 arr.(loc,com,param) v 1
;
; 210-217 zone,-arr.(loc,com,par) 3 1
;
; 218-225 external 2 1
; 226-233 external param
; 234-241 entry point name
;
; 242-249 stm.fct.call 3 1
;
; 250-257 stm.fct descr. 7 1
;
; 258-265 simple equiv. to arr. 4 1
;
; 266-273 simple equiv. to zone 5 1
;
; 274-281 arr.equiv. to zone v 1
;
; 282-289 common name 1 1
;
; 290-297 label var.description 2 1
;
; 298-305 trouble description 1 1
;
; 306 not used
; not used
;
; 512 ident no. in data stm. 1 35
; ident.no. in data stm.
;
; 2047 not used
; chapter 3: output
;
;
; <pass 5 output> ::= <end pass>
; 1
; (<trouble>)
; 0
; *
; (<unit element>)
; 1
; <global entry point list>
;
;
;
\f
; fortran, pass 5, page 10
; <unit element> ::= <end unit>
; <no.of bytes for loc arrays and loc. zones>
; *
; (<statement>)
; 0
; *
; (<statement function declaration>)
; 0
; <local entry point list>
; <label variable list>
; *
; (<common zone declaration> )
; (<common array declaration> )
; 0
; *
; (<trouble>)
; 0
; *
; (<local zone declaration> )
; (<local array declaration> )
; 0
; <end formal declarations>
; *
; (<extern. zone declaration>)
; (<formal zone declaration> )
; (<formal array declaration>)
; 0
; <end declarations>
; *
; (<data statement> )
; (<format statement> )
; (<trouble statement>)
; (<empty statement> )
; 0
; <no. of labels and no. of globals>
; 1
; (<data>)
; 0
; 1
; (<not declared labels>)
; 0
; 1
; (<multiple declared labels>)
; 0
; 1
; (<declared but not referred labels>)
; 0
; <zone common list>
; <general common list>
; <external list>
; <no.of bytes for simple loc. var.and stm.fct.par.>
; <begin unit>
;
;
\f
; fortran, pass 5, page 11
; <statement> ::= <var. assignm. statement> or
; <assign statement> or
; <simple goto statement> or
; <assigned goto statement> or
; <computed goto statement> or
; <call statement> or
; <logical if statement> or
; <arithmetical if statement> or
; <do statement> or
; <entry statement> or
; <return statement> or
; <stop statement> or
; <inout statement> or
; <format statement> or
; <trouble statement> or
; <empty statement>
;
;
; these elements together with
;
; <correct do termination>
;
; which may occur among the statements, are further described
; in the appendix. they are all composed of the below mentioned
; records.
;
; it is noticed that the <end line> - record may occur
; ewerywhere within a programunit.
\f
; fortran, pass 5, page 12
; byte- output no.of
; value record bytes
;
; 1 not used -
; 2 not used -
; .
; 33 not used -
; 34 entry 1
; 35 not used -
; 36 return 1
; 37 end unit 1
; 38 end pass 1
; 39 begin unit 1
; 40 end line 1
; 41 end stm. 1
; 42 begin list 2
; 43 end list 2
; 44 call 2
; 45 logical const. 2
; 46 int. const. 3
; 47 real const. 5
; 48 long const. 5
; 49 double const. 9
; 50 complex const. 9
; 51 not used -
; 52 not used -
; 53 label declaration 1
; 54 end format 3
; 55 cont. format 3
; 56 not used -
; 57 trouble 4
; 58 end declarations 1
; 59 end formal decl. 1
; 60 dya plus 1
; 61 not used -
; 62 dya minus 1
; 63 not used -
; 64 mult. star 1
; 65 div. slash 1
; 66 expon. 1
; 67 .shift. 1
; 68 list com 1
; 69 iocom 1
; 70 not used -
; 71 not used -
; .
; 87 not used -
; 88 data star 1
; 89 not used -
; 90 multiple equal 1
; 91 not used -
; 92 not used -
; 93 arithm. equal 1
\f
; fortran, pass 5, page 13
; 94 .lt. 1
; 95 .le. 1
; 96 .eq. 1
; 97 .ge. 1
; 98 .gt. 1
; 99 .ne. 1
; 100 .and. 1
; 101 .or. 1
; 102 .not. 1
; 103 begin closed format 3
; 104 begin open format 3
; 105 not used -
; 106 not used -
; 107 if 1
; 108 do 1
; 109 to 1
; 110 stop 1
; 111 read 2
; 112 write 2
; 113 correct do term. 1
; 114 not used -
; 115 arithm. left parent. 1
; 116 end call 2
; 117 spark 1
; 118 arithm. right parent. 1
; 119 not used -
; 120 impl. right parent. 1
; 121 not used -
; 122 vanished operand 1
; 123 simple goto 1
; 124 comp. goto 1
; 125 ass. goto 1
; 126 end arithm. if 1
; 127 end logical if 1
; 128 not used -
; 129 end do 1
; 130 end io 1
; 131 not used -
; 132 not used -
; 133 not used -
; 134 not used -
; 135 not used -
; 136 not used -
; 137 array data 1
; 138 data init 1
; 139 impl. left parent. 1
; 140 impl. do 1
; 141 impl. init spec. 1
; 142 impl. init gen. 1
; 143 impl. unt. 1
; 144 impl. step 1
; 145 do init. spec 1
; 146 do init. gen. 1
; 147 do unt. 1
; 148 do step 1
\f
; fortran, pass 5, page 14
; 149 data 1
; 150 gen. common list v
; 151 zone common list v
; 152 not used -
; 153 local entry point list v
; 154 external list v
; 155 label variable list v
; 156 no.of bytes, s.l.v.,s.f.par. 2
; 157 no.of bytes, loc.arr,zones 3
; 158 local array declaration 4
; 159 common arr. declaration 4
; 160 formal arr. declaration v
; 161 local zone declaration 9
; 162 com.zone declaration 4
; 163 form. zone declaration 5
; 164 not declared labels v
; 165 multiple decl. labels v
; 166 nulls v
; 167 global entry point v
; 168 no.of labels and no. of globals 3
; 169 external zone decl. 3
; 170 not used -
; 171 not used -
; 172 not used -
; 173 not used -
; 174 not used -
; 175 not used -
; 176 not used -
; 177 not used -
; 178-185 simple local 2
; 186-193 simple common 3
; 194-201 simple param 2
; 202-209 array(loc,com,par) v
; 210-217 zone(arr)(loc,com,par) 3
; 218-225 external 2
; 226-233 external param 2
; 234-241 entry point name 2
; 242-249 stm.fct. call 3
; 250-257 stm.fct. descr. 7
; 258-265 simple equiv. to array 4
; 266-273 simple equiv. to zone 5
; 274-281 array equiv. to zone v
; 282-289 common name 1
; 290-297 label variable descr. 2
; 298-305 trouble description 1
; 306 not used -
; 307 not used -
; .
; 511 not used -
; 512 oth label 1
; 513 1st label 1
; 514 2nd label 1
;
\f
; fortran, pass 5, page 15
; chapter 4: process
;
; 4.0 general process description
;
;
;
; the purpose of pass 5 is to
;
; 1. replace labels by labelnumbers and to
; detect erroneous usage of labels and
;
; 2. perform such macroscopic and microscopic processing,
; which can be done by a reverse pass only.
;
;
; the core store utilization during the processing of the
; executable part and during the declarative part of a
; programunit is shown below.
;
;
;
\f
; fortran, pass 5, page 16
; 4.1 assignment of label numbers and
; detection of erroneous usage of labels
;
; after having received the local entry point list, pass 5 opens
; the label table:
;
;
; label no. label ds df rs rf
; -----------------------
; 512 ! ! ! ! ! ! ds: declared statement label
; -----------------------
; 513 ! ! ! ! ! ! df: declared format label
; -----------------------
; . ! ! ! ! ! ! rs: referred statement label
; -----------------------
; . ! ! ! ! ! ! rf: referred format label
; -----------------------
;
;
; a label may be recognized in a labeldeclaration (it is then
; examined whether it is a format label (i.e. a declaration
; in a format statement), or a statement label), or
; in a label reference (it is then explicitly given whether
; it is a formatlabel (i.e. referenced in an inout-statement),
; or a statementlabel). a search through the table is
; performed; if the label is not found it is added to the
; table and the 4 counters are set to zero. then one of
; the four counters is increased by one. instead of the label,
; the label no. is output.
;
; at the <begin unit> - record the <no.of labels and globals> is cal-
; culated and output, and then a search for error labels is
; performed, and if any, one or two errorlabel-lists
; (not declared labels and multiple declared labels) are
; output. furthermore if any, a list of nulls (that is de-
; clared, but not referred labels) is output.
;
; a correct label is given by:
;
; ds=1, df=0, rf=0, if rs=0 then null (statementlabel) or
; ds=0, df=1, rs=0, if rf=0 then null (format label)
;
;
; not declared labels are labels which are referred, but not
; declared:
;
;
; ds=0, rs>0 (statement label) or
; df=0, rf>0 (format label)
;
;
; multiple declared labels are labels which are declared more
; than once, i.e.
;
;
; ds + df > 1
;
;
; it is noticed that a label at the same time may be
; -not declared- as well as -multiple declared- for
; example a label which is declared in two formatstatements,
; but referred to as a statementlabel.
\f
; fortran, pass 5, page 17
;
;
; core store utilization during the processing of:
;
; executable part no.of declarative part
; words
;
; ----------------------------- --- -------------------------------
; ! file processor ! 768 ! file processor !
; ! ! ! !
; ----------------------------- --- -------------------------------
; ! general pass ! 561 ! general pass !
; ! ! ! !
; ----------------------------- --- -------------------------------
; ! pass 5 ! 1650 ! pass 5 !
; ! ! ! !
; ----------------------------- --- -------------------------------
; ! global entry point list ! ! global entry point list !
; ! incl. local entries ! ! incl. local entries !
; ----------------------------- -------------------------------
; ! lable table ! ! lable table !
; ! ! ! !
; ----------------------------- -------------------------------
; ! input- output record ! ! input-output record !
; ----------------------------- -------------------------------
; ! ! ! error lables and nulls !
; ! ! -------------------------------
; ! not used ! ! not used !
; ! ! -------------------------------
; ! ! 468 ! <end list>-stack in data !
; ----------------------------- -------------------------------
; ! ! ! data buffer !
; ! ! -------------------------------
; ! stack for: ! ! general common list !
; ! ! -------------------------------
; ! parentheses ! ! zone common list !
; ! goto, if ! -------------------------------
; ! do loops ! ! com. var. in data stm. !
; ----------------------------- -------------------------------
; ! local entry point list ! ! local entry point list !
; ! ! ! !
; ----------------------------- --------------------------------
; ! external list ! ! external list !
; ! ! ! !
; ----------------------------- -------------------------------
; ! lable variable list ! ! lable variable list !
; ! ! ! !
; ----------------------------- --- -------------------------------
; ! general pass buffer ! 512 ! general pass buffer !
; ! ! ! !
; ----------------------------- --- -------------------------------
; ! file processor buffer ! 1041 ! file processor buffer !
; ! ! ! !
; ----------------------------- --- -------------------------------
; 5000
;
;
\f
; fortran, pass 5, page 18
; 4.2 reverse processing
; 4.2.1 macroscopic reverse processing
;
;
; when initialized pass 5 outputs the end pass record, and
; when the end pass record is input, the global entry point
; list is output.
;
; within each unit the following lists are stored:
;
; no. of bytes for simple loc. var. and stm. fct. param.
; label variable list
; external list
; local entry point list
; common variables in data statements
; zone common list
; general common list
;
; and the local entry point list is copied to the global entry
; point list.
;
; after the executable statements the
;
; local entry point list and
; label variable list
;
; are output.
;
; when the begin unit record is met, the following lists
; are output:
;
; external list
; zone common list
; general common list
; no. of bytes for simple loc. var. and stm. fct. param.
;
; besides the number of labels and the number of globals, and
; the two error label lists, and the nulls, mentioned above.
; if a unit contains datastatements the data record is
; output just before the possible error label lists.
;
; input of an external identification involves a search through
;
; external list
; global entry point list
; zone common list
; general common list
;
; and if the identnumber is found, the 8-byte external
; representation is added to the list.
; if the correct do termination record or the erroneous
; do termination record is met, a true or a false element
; respectively is added to the stack. when the end do
; record is input an element is taken from the stack;
; if the element is false a trouble statement is output
; instead of the do statement.
\f
; fortran, pass 5, page 19
; 4.2.2 microscopic reverse processing
;
;
; the parentheses are processed in this way by means of the stack:
;
; <io)> is removed.
; <arithmetical (> is
; copied if the right parenthesis was <arithmetical)>.
; altered to <implied (> if the right parenthesis
; was <implied )>.
; removed if the right parenthesis was <io)>.
;
; the number of listelements is copied from the <end list> -
; or the <end call> - record to the <begin list> - , the
; <call> -, the <read> - or to the <write> - record.
;
; <goto> is replaced by <simple goto>, <assigned goto> or
; <computed goto>.
;
; in logical and arithmetical if statements the <end logical if> and
; the <end arithmetical if>, respectively, is removed, replacing
; the <end if expression>.
;
; in a troublestatement each operand (i.e. 1) constant
; (logical -, integer -, long -, real -, double - or complex
; constant), 2) variable description (or in data statements
; the identnumber) (simple variable, label variable, array, zone,
; procedure), and 3) label reference) is replaced by
; the <vanished operand> - record. the <vanished
; operand> - records after the first <trouble> - record,
; the <end statement> - and the <trouble> -
; records are copied. the <end line> -, the <external
; identification> -, and the <label declaration> -
; records are processed in the usual way, the rest of
; the records (including the <vanished operand> - records
; before the first <trouble> - record) are removed.
; 4.2.2.1 do statement
;
;
; if each of the 3 parametres is
;
; either an integerconstant
;
; or a simple integervariable (whether this is
; formal, local, equivalized to en element of an
; array or a zone)
;
; the <do init. special> - record is output after the
; parametres. contrary the <do init. general> - record is
; output.
;
; the <do equal> - record are removed.
;
;
\f
; fortran, pass 5, page 20
; 4.2.2.2 implied do loop
;
;
; if each of the 3 parametres is
;
; either an integerconstant
;
; or a simple integervariable (whether this is
; formal, local, equivalized to an element of an
; array or a zone)
;
; the <implied init. special> - record is output after the
; parametres. contrary the <implied init. general> - record
; is output.
;
; the <implied equal> - record is removed.
; 4.2.2.3 data statement
;
;
; the constants and the variables are paired, and the
; <end data> -, <data slash> -, <data group separator>
; -records are removed.
;
; it is checked that the number of constants corresponds
; to the number of variables, and if this is not the case,
; a <trouble> - record is output at the end of the datagroup.
;
; for each identifier number the description is found in
; the <common variables in data statements> - list. if
; the description is not found, the variable is not in common,
; and a <trouble> - description and a <trouble> - record are
; output instead of the missing description.
;
; for each assignment the <spark> - record is output.
;
; if the constants are followed by an (not subscripted)
; arraydescription, the <array data> is output before each
; constantgroup, and before the arraydescription the
; <data init> is output.
;
; between the constant and the simple variable - or the
; subscripted variable description the <arithmetical equal>
; - record is output.
;
; if a repetitionfactor is equal to one, neither this nor the
; datastar are output.
; within each datastatement the datagroups are counted.
\f
; fortran, pass 5, page 21
; 4.2.2.4 parentheses and the stack
;
; the input to pass 5 contains a structure of parentheses:
;
;
;
; left parenthesis: right parenthesis:
;
; <end do> <correct do termination>
; <end do> <erroneous do termination>
; <end if expression> <end arithmetical if>
; <end if expression> <end logical if>
; <goto> <end simple goto>
; <goto> <end assigned goto>
; <goto> <end computed goto>
; <arithmetical(> <io)>
; <arithmetical(> <arithmetical)>
; <arithmetical(> <implied)>
; <begin list> <end list>
; <read> <end list>
; <write> <end list>
; <call> <end list>
; <call> <end call>
;
;
;
;
; pass 3 is so designed that if it
; recognizes a trouble before the left parenthesis
; neither the left nor the right parenthesis are out-
; put, if a trouble is recognized between the
; parentheses only the left one is output, and if
; a trouble after the right parenthesis or no trouble
; is recognized both the left and the right parenthesis
; are output.
;
;
; consequently pass 5 is so designed that the right
; parenthesis is stacked only if a trouble is not yet
; recognized within the statement, and a paren-
; thesis is unstacked when the left parenthesis is
; met only if a trouble is not yet recognized.
;
;
\f
; fortran, pass 5, page 22
; 4.3 input - and output records
;
;
; the records are input, stored and output as described
; below (the stored record is showed in the right column):
;
;
; 1. fixed length record:
;
; pass 4 output pass 6 input
;
; a <directing byte>
; b a
; c b
; <directing byte> c
;
; pass 5 input pass 5 output
;
;
; 2. variable length record:
;
; pass 4 output pass 6 input
;
; a <directing byte>
; b <no. of bytes>
; c a
; <no. of bytes> b
; <directing byte> c
;
; pass 5 input pass 5 output
\f
; fortran, pass 5, page 23
; 4.4 trouble records and error messages
;
;
; when a do - range is erroneous terminated, the do statement
; is replaced by this trouble record:
;
; 0 0 e86+0 <direction byte>
;
;
; if the number of constants do not equal the number of
; elements in a data group of a datastatement, this
; troublerecord is output:
;
; 0 <datagroup no.> e86+1 <direction byte>
;
;
; if in a datastatement a simple variable or an array is not
; in common the troublerecord:
;
; 0 <datagroup no.> e86+2 <direction byte>
;
; is output instead of the rest of the data group.
;
;
; if the listsize, the stacksize, or the size of a record
; exceeds the size of the free core, the translation is terminated
; after the message:
;
; process too small
;
; a greater process must be created.
;
;
; when pass 5 receives an unknown record, the translation is
; terminated after the message:
;
; <direction byte> unknown record to pass 5
;
; this is due to an programming error in pass 4 or pass 5.
;
;
; (furthermore the
;
; <not declared labels> - record
; <multiple declared labels> - record
; (<declared but not referred labels> - record)
;
; may be taken as a kind of troublerecords).
;
\f
; fortran, pass 5, page 24
; chapter 5: the program
;
;
; the usage of labels
;
; a: local labels
; b: local variables
; c: action entries
; d: procedure entries
; e: not used (general pass)
; f: global constants and variables
; g: stepping stones
; h: not used (file processor)
; i: miscellaneous
; j: miscellaneous
s. c99, d20, f55, g21, i25, j99 ; begin pass 5
k = e0
w. i20: i21 ; no.of bytes in pass 5
h. i22 ; entry point rel. to 1st word
5<1 + 1 ; pass no.<1 + direction change
b. a1 ; action 0
; if trouble is false, the record is output.
w.
c0: am. (f38.) ; begin
se w1 x1 0 ;
jl. a1. ; if not trouble then
dl. w1 f8. ; outrec(length,record)
jl. w3 g15. ;
a1: jl. d1. ; end
e.
b. ; action 1
; if trouble is false the record is output, contrary the
; <vanished operand> - record is output.
w.
c1: al w0 1 ; begin
al. w1 f46. ;
al w1 x1 21 ;
am. (f38.) ; outrec(length,
sn w1 x1 0 ; if trouble
dl. w1 f8. ; then <van. op.>
jl. w3 g15. ; else record)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 25
b. ; action 2
; the <end line> - record is output, and a jump back to
; inrec is performed.
w.
c2: jl. w3 g1. ; begin
dl. w1 f8. ; carret.
jl. w3 g15. ; outrec(1,<end line>)
jl. g14. ; end
e.
b. ; action 3
; datagroup no. is set to zero.
; trouble and format label declaration are both set to false,
; the <end statement> - record is output, and a jump back to
; inrec is performed.
w.
c3: al w0 0 ; begin
rs. w0 f38. ; trouble := false
rs. w0 f37. ; form.lab.decl. := false
rs. w0 f54. ; datagroupno. := 0
dl. w1 f8. ;
jl. w3 g15. ; outrec(1,<end stm.>)
jl. g14. ; end
e.
\f
; fortran, pass 5, page 26
b. a8 ; action 4
; a search for the ident no. is performed through the:
; external list
; global entry point list (local part)
; zone common list
; general common list
; until the ident no. is found and the external representation
; has been inserted.
; finally a jump back to inrec is performed.
w.
c4: dl. w1 f8. ; begin
am (0) ;
bl w0 x1 -1 ;
rl. w1 f26. ;
sn w1 0 ; if fba - external list=0
jl. a2. ; or
al w2 9 ; listsearch
hs w2 0 ; (fba+3,lba-8,9,ident)
al w1 x1 3 ; = 0
rl. w2 f27. ;
al w2 x2 -8 ; then
jl. w3 g20. ;
se w1 0 ;
jl. a8. ;
a2: rl. w1 f3. ;
sn w1 0 ; if fwa - glob.ep.list=0
jl. a4. ; or
al w2 12 ; listsearch
hs w2 0 ; (fwa+0,lwa-10,12,ident)
rl. w2 f4. ; =0
al w2 x2 -10 ; then
jl. w3 g20. ;
se w1 0 ;
jl. a8. ;
a4: rl. w1 f20. ;
sn w1 0 ; if fba - zone com. list=0
jl. a6. ; or
al w2 17 ; listsearch
hs w2 0 ; (fba+2,lba-1,17,ident)
al w1 x1 2 ; = 0
rl. w2 f21. ;
al w2 x2 -1 ; then
jl. w3 g20. ;
se w1 0 ;
jl. a8. ;
a6: rl. w1 f18. ;
sn w1 0 ; if fba - gen.com.list=0
jl. a8. ; or
al w2 12 ; listsearch
hs w2 0 ; (fba+2,lba-12,12,ident)
al w1 x1 2 ; = 0
rl. w2 f19. ;
al w2 x2 -12 ; then
jl. w3 g20. ;
a8: jl. g14. ; end
e.
\f
; fortran, pass 5, page 27
b. a0, b0 ; action 5
; trouble is set to false, labelsearch is called, and the
; <label declaration> - record is output.
; finally a jump back to inrec is performed.
w. b0: 0 ; saved old trouble
c5: al w0 0 ; begin
rx. w0 f38. ; trouble := false
rs. w0 b0. ; save (old trouble);
am. (f8.) ;
dl w1 +2 ; labelsearch(label,
ld w1 +12 ; if form.lab. then df
rl. w1 f37. ; else ds)
jl. w3 g16. ;
rl. w0 b0. ;
rl. w1 f37. ;
se w0 0 ; if old trouble
sn w1 0 ; and format label then
jl. a0. ; begin
al w0 1 ;
rl. w3 f52. ; w3 := last found label-entry;
ba w0 x3 +2 ; increase(counter(label,ds);
sh w0 2047 ; (unless overflow)
hs w0 x3 +2 ;
a0: ; end;
al w0 1 ;
al. w1 f41. ; outrec(1,
al w1 x1 33 ; <label decl.>)
jl. w3 g15. ;
jl. g14. ; end
e.
b. ; action 6
; the length of the global entry point list is calculated,
; and the list is output.
; finally pass 5 is finished.
w.
c6: dl. w2 f2. ; begin
ws w2 2 ; glob.ep.list(1) :=
hs w2 x1 +1 ; no. of bytes
al w0 x2 2 ; glob.ep.list(0) :=
am 9 ;
bl. w2 f48. ; bytevalue
al w2 x2 4 ; outrec
hs w2 x1 +0 ; (length,<glob.ep.list>)
jl. w3 g15. ; finish
jl. g7. ; end
e.
b. ; action 7
; the record is output.
w.
c7: dl. w1 f8. ; begin
jl. w3 g15. ; outrec(length, record)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 28
b. a2, b1 ; action 8
; the <no. of labels - and the no. of globals> - record
; is output.
; if data is true, the <data> - record is output.
; a search for not declared labels is performed, and if any,
; a list is output.
; a search for multiple declared labels is performed, and if
; any, a list is output.
; a search for declared but not referred labels (nulls) is
; performed, and if any, a list is output.
; the zone common list, the general common list, and the
; external list are output.
; the first free word and the last free word are recalculated.
; the <no. of bytes for simple local variables and stm. fct.
; param.> - record is output.
; the fba and the lba for common variables in data statements
; are set to zero.
; trouble is set to false
; the <begin unit> - record is output.
h. b0: 0 ; <begin unit>-record
w. b1: 6 ;
\f
; fortran, pass 5, page 29
c8: bl. w0 (f8.) ; begin
hs. w0 b0. ;
rl. w0 f35. ;
al. w1 f53. ; no. of globals :=
ba w0 x1 +2 ; no. of globals +
hs w0 x1 +2 ; data
rl. w1 f6. ;
ws. w1 f5. ; number :=
al w1 x1 +2 ; (lwa - fwa + 2)/6 +
al w0 0 ; 511
wd. w1 b1. ;
al w1 x1 511 ;
am. f53. ;
hs w1 +1 ;
al w0 3 ; outrec(3,
al. w1 f53. ; <no. of labels, globals>)
jl. w3 g15. ;
al w0 1 ;
se. w0 (f35.) ;
jl. a2. ; if data then
al. w1 f33. ; outrec(1,
al w1 x1 13 ;
jl. w3 g15. ; <data>)
a2: jl. w3 g21. ; tablesearch
rl. w1 f20. ;
al w0 2 ; outrec(length,
ba w0 x1 +1 ; <zone com. list>)
jl. w3 g15. ;
rl. w1 f18. ;
al w0 2 ; outrec(length,
ba w0 x1 +1 ; <gen. com. list>)
jl. w3 g15. ;
rl. w1 f26. ;
al w0 2 ; outrec(length,
ba w0 x1 +1 ; <external list>)
jl. w3 g15. ;
jl. w3 g9. ; lfw :=
rs. w0 f11. ; last free word
; the following is just to facilitate the 'names.yes' option in pass 7
al w0 1 ;
al. w1 f55. ; outrec(1,<number of local entries>);
jl. w3 g15. ;
al w0 2 ;
al. w1 f36. ; outrec(2,<no. of bytes>)
jl. w3 g15. ;
al w0 0 ; fba := lba := 0 for
rs. w0 f22. ; com. var. in data-stm.
rs. w0 f23. ;
rs. w0 f18. ; fba(gen com list) := 0;
rs. w0 f20. ; fba(zone com list) := 0;
rs. w0 f38. ; trouble := false
rl. w1 f4. ;
al w1 x1 2 ; ffw := 2 +
rs. w1 f10. ; lwa - local entries
rs. w1 f8. ;
al w0 1 ;
al. w1 b0. ; outrec(1,<begin unit>)
jl. w3 g15. ;
jl. d1. ; end
e.
\f
; fortran, pass 5, page 30
b. a1, b2 ; action 9
; the external list including 8 bytes per external is sto-
; red, the fba, the lba, and the lfw are calculated.
; the new length of the list is calculated.
; it is checked that the free core store is not exceeded.
w. b0: 0 ; n
b1: 9 ;
b2: 2 ;
c9: rl. w0 (f8.) ; begin
bl w1 1 ; i := record(1)
al w3 x1 -1 ;
al w2 0 ;
wd. w3 b2. ; n := (i - 1)/2
rs. w3 b0. ;
wm. w3 b1. ;
al w3 x3 1 ; m := 1 + 9*n
hl w0 7 ;
rl. w2 f11. ;
al w2 x2 1 ;
rs. w2 f27. ; lba := 1 + lwa
ws w2 6 ;
al w2 x2 -1 ;
rs. w2 f26. ; fba := lba - m - 1
al w2 x2 -2 ;
la. w2 f39. ; lwa :=
rs. w2 f11. ; (fba - 2) and mask
am. (f8.) ;
al w2 x3 -1 ;
sl. w2 (f11.) ; if record + m > lfw
jl. g17. ; then stackerror
rl. w2 f26. ;
hs w0 x2 +1 ; list(1) := m
ls w0 -12 ;
hs w0 x2 +0 ; list(0) := record(0)
wa. w1 f8. ;
rl. w2 f27. ;
al w2 x2 -8 ;
bl w0 x1 +1 ; list(m+1) :=
hs w0 x2 +8 ; record(i+1)
a1: bl w0 x1 +0 ; for j := n step -1
hs w0 x2 +0 ; until 1 do
bl w0 x1 -1 ; begin
hs w0 x2 -1 ; list(9*j-6):=rec(2*j+1)
al w0 1 ;
hs w0 x2 +7 ; (entry contains an ident no := true)
al w1 x1 -2 ; list(9*j-7):=rec(2*j+0)
al w2 x2 -9 ;
sl. w2 (f26.) ; end
jl. a1. ;
jl. d1. ; end
e.
\f
; fortran, pass 5, page 31
b. a4, b6 ; action 10
; the local entry point list is stored, and the fba, the lba,
; and the lfw is calculated.
; the descriptions of the local entries are added to the glo-
; bal entry point list, and the lwa of the global entry point
; list is recalculated.
; it is checked that the free core store is not exceeded.
; the label table is opened, and the fwa of the inout-record
; is recalculated.
; the lwa of the data buffer is set to zero.
; the fba and lba of the empty stack is calculated.
; data is set to false.
; the counter of the <no. of globals> - record is set to one.
w.
b1: 0 ; n
f55 = b1+1 ; number of local entries
b2: 2 ;
b3: 12 ;
b4: 0 ; loc(rec(i))
b5: 0 ; save parameter
b6: 0 ; description
c10: rl. w0 (f8.) ; begin
bl w1 1 ;
al w3 x1 -4 ;
al w2 0 ;
wd. w3 b2. ; n := (i - 4)/2
rs. w3 b1. ;
hl w0 7 ; m := n
rl. w2 f11. ;
al w2 x2 1 ;
rs. w2 f25. ; lba := lfw + 1
ws w2 7 ;
al w2 x2 -1 ;
rs. w2 f24. ; fba := lba - m - 1
al w2 x2 -2 ;
la. w2 f39. ; lfw :=(fba - 2) and mask
rs. w2 f11. ;
rl. w2 f24. ;
hs w0 x2 +1 ; local(1) := m
ls w0 -12 ;
hs w0 x2 +0 ; local(0) := record(0)
rl. w1 f2. ;
al w2 x1 2 ; fwa - local entries :=
rs. w2 f3. ; 2 + lwa - global
rl. w3 b1. ;
wm. w3 b3. ; lwa - global :=
wa w1 6 ; lwa - local :=
rs. w1 f4. ; lwa - global +
rs. w1 f2. ; 12*n
sl. w1 (f24.) ; if lwa - global ep. list
jl. d7. ; >= fba then stackerror
\f
; fortran, pass 5, page 32
rl. w2 f8. ; w2=base of in-out record
ba w2 x2 +1 ; w2=w2+no. of bytes in record
dl w1 x2 ; w0,w1=param description
ds. w1 b6. ; save param description
al. w1 b6. ; save address of
rs. w1 b4. ; param description
al w2 x2 -4 ; w2=address of main entry no.
rl. w1 f25. ;
al w1 x1 -1 ;
rl. w3 f4. ; until 1 do
al w3 x3 -10 ; begin
a4: bl w0 x2 +1 ; local(1 + j) :=
hs w0 x1 +1 ; record(1 + 2*j)
bl w0 x2 +0 ; global(0 + 12*(j-1)):=
hs w0 x3 +0 ; record(0 + 2*j)
rx. w2 b4. ;
bl w0 x2 +1 ; global(11 + 12*(j-1)):=
hs w0 x3 +11 ; record(i + 1)
bl w0 x2 +0 ; global(10 + 12*(j-1)):=
hs w0 x3 +10 ; record(i+0)
bl w0 x2 -1 ; global(9 + 12*(j-1)):=
hs w0 x3 +9 ; record(i-1)
bl w0 x2 -2 ; global(8 + 12*(j-1)):=
hs w0 x3 +8 ; record(i-2)
al w0 1 ;
hs w0 x3 +7 ; (entry contains an ident no := true)
rx. w2 b4. ;
al w1 x1 -1 ;
al w2 x2 -2 ;
al w3 x3 -12 ;
sl. w3 (f3.) ;
jl. a4. ; end
rl. w1 f2. ; lwa - label table :=
rs. w1 f6. ; lwa - global ep. list
al w1 x1 2 ; fwa - label table :=
rs. w1 f5. ; 2 + lwa - label table
al w1 x1 2 ; fwa - inout record :=
rs. w1 f8. ; 2 + lwa - label table
al w1 0 ; lwa - data buffer
am 2 ;
rs. w1 f15. ; := 0
rl. w1 f11. ;
al w1 x1 1 ; lba - stack :=
rs. w1 f17. ; lfw + 1
al w1 x1 1 ; fba - stack :=
rs. w1 f16. ; lba + 1
al w0 0 ; data :=
rs. w0 f35. ; false
al w0 1 ;
am. f53. ; no. of globals := 1
hs w0 +2 ;
jl. d1. ; end
e.
\f
; fortran, pass 5, page 33
b. a4 ; action 11
; the record containing descriptions of the common variables
; in data - statements is stored, and the fwa and the lwa
; are calculated.
; the address of the lfw is recalculated.
; the local entry point list, if any, is output, and the fba and
; lba are set to zero.
; the label variable list, if any, is output, and the fba
; and the lba are set to zero.
; trouble is set to false.
w.
c11: am. (f8.) ; begin
bl w1 +2 ;
rl. w2 f11. ;
al w2 x2 1 ; lba := 1 + lfw
rs. w2 f23. ;
ws w2 3 ;
al w0 x2 2 ; fba := lba-(rec(2)-1)+1
rs. w0 f22. ; if fba < fwa
sh. w0 (f8.) ; then stackerror
jl. d7. ; addr := fba
a0: sl. w0 (f23.) ; for i := n step -1
jl. a1. ; until 1 do
rl w1 0 ; begin
jl. w3 d3. ; inrec(addr;
rl. w3 f7. ; length, dummy)
wa w0 6 ; addr := addr + length
sh w3 3 ; if array then
jl. +14 ; begin
jl. w3 g2. ; inbyte(<elemno>,addr)
hs w2 (0) ; addr := addr + 1
ba. w0 1 ; end
jl. w3 g2.
hs w2 (0)
ba. w0 1
jl. w3 g2. ; inbyte(<ident.no.>,addr)
hs w2 (0) ;
ba. w0 1 ; addr := addr + 1
jl. a0. ; end
a1: rl. w2 f22. ;
al w2 x2 -2 ; lwa :=
la. w2 f39. ; (fba - 2) and mask
rs. w2 f11. ;
al w0 0 ; trouble :=
rs. w0 f38. ; false
rl. w1 f24. ;
sn w1 0 ; if fba-loc. ep. list
jl. a2. ; <> 0 then
al w0 2 ; begin
ba w0 x1 1 ; outrec(length,
jl. w3 d5. ; <loc.ep.list>)
al w0 0 ;
rs. w0 f24. ; fba := lba := 0
rs. w0 f25. ; end
a2: rl. w1 f28. ;
sn w1 0 ; if fba-label var.list
jl. a4. ; <> 0 then
al w0 2 ; begin
ba w0 x1 1 ; outrec(length,
jl. w3 d5. ; <lab.var.list>)
al w0 0 ;
rs. w0 f28. ; fba := lba := 0
rs. w0 f29. ; end
a4: jl. d1. ; end
e.
\f
; fortran, pass 5, page 34
b. a6, b2 ; action 12
; the zone common list incl. 8 bytes per block is stored,
; and the fba and lba are calculated.
; the lfw is recalculated.
; if the free core store is exceeded, stackerror is called.
w. b0: 10 ;
b1: 0 ; list(0), list(1)
b2: 17 ;
c12: rl. w0 (f8.) ; begin
bl w1 1 ;
rl. w3 f11. ;
al w3 x3 +1 ; lba := 1 + lfw
rs. w3 f21. ;
al w3 x1 -1 ;
al w2 0 ; no. := (i - 1)/10
wd. w3 b0. ;
wm. w3 b2. ;
al w3 x3 1 ; m := 1 + 17*no.
hs w3 1 ;
rs. w0 b1. ;
am. (f8.) ;
al w2 x3 +0 ;
sl. w2 (f11.) ; if m + record > lfw
jl. d7. ; then stackerror
rl. w2 f21. ;
ws w2 6 ; fba :=
al w2 x2 -1 ; lba - m - 1
rs. w2 f20. ;
al w2 x2 -2 ;
la. w2 f39. ; lfw :=
rs. w2 f11. ; (fba - 2) and mask
wa. w1 f8. ;
rl. w2 f21. ; list(m + 1) :=
al w2 x2 -1 ; record(i + 1)
bl w0 x1 +1 ; for j := no. of blocks
hs w0 x2 +1 ; step -1 until 1 do
a2: am. (f20.) ; begin
sn w2 +1 ;
jl. a6. ;
al w3 10 ;
a4: bl w0 x1 0 ;
hs w0 x2 0 ;
al w1 x1 -1 ; copy(9 bytes)
al w2 x2 -1 ;
al w3 x3 -1 ;
se w3 0 ; reserve(7 bytes)
jl. a4. ;
al w2 x2 -7 ;
hs w0 x2 +1 ; copy(ident no.)
al w0 1 ;
hs w0 x2 +8 ; (entry contains an entry no := true)
jl. a2. ; end
a6: rl. w0 b1. ;
hs w0 x2 0 ; list(1) := m
ls w0 -12 ;
hs w0 x2 -1 ; list(0) := record(0)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 35
b. a6, b2 ; action 13
; the general common list incl. 8 bytes per block is stored,
; and the fba and lba are calculated.
; the lfw is recalculated.
; if the free core store is exceeded, stackerror is called.
w. b0: 5 ;
b1: 0 ; list(0), list(1)
b2: 12 ;
c13: rl. w0 (f8.) ; begin
bl w1 1 ;
rl. w3 f11. ;
al w3 x3 +1 ; lba := 1 + lfw
rs. w3 f19. ;
al w3 x1 -1 ;
al w2 0 ; no. := (i - 1)/5
wd. w3 b0. ;
wm. w3 b2. ;
al w3 x3 1 ; m := 1 + 12*no.
hs w3 1 ;
rs. w0 b1. ;
am. (f8.) ;
al w2 x3 +0 ;
sl. w2 (f11.) ; if m + record > lfw
jl. d7. ; then stackerror
rl. w2 f19. ;
ws w2 6 ; fba :=
al w2 x2 -1 ; lba - m - 1
rs. w2 f18. ;
al w2 x2 -2 ;
la. w2 f39. ; lfw :=
rs. w2 f11. ; (fba - 2) and mask
wa. w1 f8. ;
rl. w2 f19. ; list(m + 1) :=
al w2 x2 -1 ; record(i + 1)
bl w0 x1 +1 ; for j := no. of blocks
hs w0 x2 +1 ; step -1 until 1 do
a2: am. (f18.) ; begin
sn w2 +1 ;
jl. a6. ;
al w3 5 ;
a4: bl w0 x1 0 ;
hs w0 x2 0 ;
al w1 x1 -1 ; copy(4 bytes)
al w2 x2 -1 ;
al w3 x3 -1 ;
se w3 0 ; reserve(7 bytes)
jl. a4. ;
al w2 x2 -7 ;
hs w0 x2 +1 ; copy(ident no.)
al w0 1 ;
hs w0 x2 +8 ; (entry contains an entry no := true)
jl. a2. ; end
a6: rl. w0 b1. ;
hs w0 x2 0 ; list(1) := m
ls w0 -12 ;
hs w0 x2 -1 ; list(0) := record(0)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 36
b. ; action 14
; a search for the referred format label is performed through
; the label table.
w.
c14: am. (f8.) ; begin
dl w1 +2 ;
ld w1 12 ; labelsearch(label,3)
al w1 3 ;
jl. w3 g16. ;
jl. d1. ; end
e.
b. ; action 15
; a search for the referred statement label is performed
; through the label table.
w.
c15: am. (f8.) ; begin
dl w1 +2 ;
ld w1 12 ; labelsearch(label,2)
al w1 2 ;
jl. w3 g16. ;
jl. d1. ; end
e.
b. ; action 16
; a true - element is stacked, and the <correct do termination>
; - record is output.
w.
c16: al w0 1 ; begin
jl. w3 d8. ; stack(true)
al w0 1 ;
rl. w1 f8. ; outrec(1,<corr.do term.>)
jl. w3 d5. ;
jl. d1. ; end
e.
b. ; action 17
; a false - element is stacked.
; it is noticed that the <erroneous do termination> -
; record is not output.
w.
c17: al w0 0 ; begin
jl. w3 d8. ; stack(false)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 37
b. ; action 18
; format label declaration is set to true, and if trouble is
; false, the <begin format> - record is output.
w.
c18: al w2 1 ; begin
rs. w2 f37. ; form. lab. decl. := true
dl. w1 f8. ; if not trouble then
se. w2 (f38.) ; outrec
jl. w3 d5. ; (length,<beg.form.>)
jl. d1. ; end
e.
b. a1 ; action 19
; if trouble is false, the recordbyte is stacked and output.
w.
c19: am. (f38.) ; begin
se w1 x1 0 ; if not trouble then
jl. a1. ; begin
al w0 1 ; spec :=
rs. w0 f30. ; true
bl. w0 (f8.) ; stack(record)
jl. w3 d8. ; outrec(length,record)
dl. w1 f8. ;
jl. w3 d5. ; end
a1: jl. d1. ; end
e.
b. a1 ; action 20
; if trouble is false, -(no. of elements) is stacked, and
; the <end list> - record are output.
w.
c20: am. (f38.) ; begin
se w1 x1 0 ;
jl. a1. ; if not trouble then
am. (f8.) ; begin
bl w0 +1 ; stack
ac w0 (0) ; (-no.of elements)
jl. w3 d8. ; outrec
dl. w1 f8. ; (length,<end list>)
jl. w3 d5. ; end
a1: jl. d1. ; end
e.
\f
; fortran, pass 5, page 38
b. ; action 21
; if trouble is false, the recordbyte is stacked.
w.
c21: bl. w0 (f8.) ; begin
am. (f38.) ;
sn w1 x1 0 ; if not trouble then
jl. w3 d8. ; stack(record)
jl. d1. ; end
e.
b. a4 ; action 22
; if trouble is false an element is taken from the stack.
; if this element is the <arithm.)> or the <impl.)>, the
; <aritm.(> or the <impl.(>,respectively, is output.
w.
c22: am. (f38.) ; begin
se w1 x1 0 ; if trouble
jl. a4. ; then goto a4
jl. w3 d9. ; unstack(byte)
al w0 1 ;
rl. w1 f8. ; outrec
am 5 ;
bl. w2 f46. ;
sn w3 x2 0 ; if byte = <arithm.)>
jl. a2. ; then (1,<arithm.(>)
al. w1 f33. ; else
al w1 x1 3 ;
am 13 ;
bl. w2 f46. ; if byte = <impl.)>
sn w3 x2 0 ; then (1,<impl.(>)
a2: jl. w3 d5. ;
a4: jl. d1. ; end
e.
b. a1 ; action 23
; if trouble is false, -(no. of elements) is unstacked, and
; the no. of elements is added to the record, which is then
; output.
w.
c23: am. (f38.) ; begin
se w1 x1 0 ; if not trouble then
jl. a1. ; begin
jl. w3 d9. ; unstack
ac w3 x3 0 ; (-no. of elements)
rl. w1 f8. ; record(1) :=
hs w3 x1 +1 ; no. of elements
al w0 2 ; outrec(2,record)
jl. w3 d5. ; end
a1: jl. d1. ; end
e.
\f
; fortran, pass 5, page 39
b. a1, b0 ; action 24
; if trouble is false, an element is unstacked and then output.
h. b0: 0 ; output record
w.
c24: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a1. ; begin
jl. w3 d9. ; unstack(rec)
al. w1 b0. ; outrec
hs w3 x1 +0 ; (1, rec)
jl. w3 d5. ; end
a1: jl. d1. ; end
e.
b. a2 ; action 25
; if trouble is false, the <end call> - record is supplied
; with a zero - byte, which is stacked, and the record is
; output.
w.
c25: al w0 0 ; begin
se. w0 (f38.) ; if not trouble then
jl. a2. ; begin
rl. w1 f8. ; no := 0
hs w0 x1 +1 ; record :=
jl. w3 d8. ; <end call><no>
al w0 2 ; stack(-no)
jl. w3 d5. ; outrec(2,record)
a2: jl. d1. ; end
; end
e.
\f
; fortran, pass 5, page 40
b. ; stepping stones
; for the fileprocessor
; and some procedures
w. ; begin
g1: jl. e1. ; carret.
g2: jl. e2. ; inbyte
g3: jl. e3. ; outbyte
g5: jl. e5. ; alarm
g7: jl. e7. ; terminate pass
g9: rl. w0 4 + e9. ; last word
jl x3 +0 ;
g10: jl. e14. ; write integer
g14: jl. d4. ; inrec
g15: jl. d5. ; outrec
g16: jl. d6. ; labelsearch
g17: jl. d7. ; stackerror
g20: jl. d10. ; listsearch
g21: jl. d11. ; tablesearch
; end
e.
b. ; head program
; the head program first initializes pass 5 and then for
; every input record it goes through an action(class)
; until pass 5 is finished after having read the <end pass>
; record.
; it is noticed that all procedures (but not the actions)
; store and reload the w - registers.
w. i22 = k - i20
d0: jl. d13. ; entry pass 5, initialize
d1: rl. w1 f8. ; inrec(record;
jl. w3 d3. ; length,action)
d2: am. (f9.) ;
jl. i0. ; action
e.
i0 = k
\f
; fortran, pass 5, page 41
; no.of
; elem. basev. length action
h.f40: 33 , 1 , 1 , j99 ; not used
1 , 0 , 1 , j0 ; entry
1 , 0 , 1 , j37 ; data group sep.
1 , 0 , 1 , j0 ; return
1 , 0 , 1 , j7 ; end unit
1 , 0 , 1 , j6 ; end pass
1 , 0 , 1 , j8 ; begin unit
1 , 0 , 1 , j2 ; end line
1 , 0 , 1 , j3 ; end statement
1 , 0 , 1 , j23 ; begin list
f41: 1 , 0 , 2 , j20 ; end list
1 , 0 , 1 , j23 ; call
1 , 0 , 2 , j1 ; logical const.
1 , 0 , 3 , j1 ; integer const.
2 , 0 , 5 , j1 ; real and long const.
2 , 0 , 9 , j1 ; double and complex const.
1 , 0 , 3 , j15 ; statement label
1 , 0 , 3 , j14 ; format label
1 , 0 , 3 , j5 ; label declaration
f42: 2 , 0 , 3 , j0 ; end format,continue format
1 , 0 , 0 , j4 ; external ident.
1 , 0 , 4 , j39 ; trouble
1 , 0 , 1 , j7 ; end declarations
1 , 0 , 1 , j7 ; end formal declarations
1 , 0 , 1 , j0 ; dya plus
1 , 0 , 1 , j99 ; not used
1 , 0 , 1 , j0 ; dya minus
1 , 0 , 1 , j99 ; not used
5 , 0 , 1 , j0 ; mult star,...,listcom
1 , 0 , 1 , j33 ; iocom
f43: 2 , 0 , 1 , j53 ; impl. init. const., var.
1 , 0 , 1 , j55 ; impl. init. gen.
2 , 0 , 1 , j49 ; impl. until const., var.
1 , 0 , 1 , j51 ; impl. unt. gen.
2 , 0 , 1 , j46 ; impl. step const., var.
1 , 0 , 1 , j47 ; impl. step gen.
2 , 0 , 1 , j52 ; do init. const., var.
1 , 0 , 1 , j54 ; do init. gen.
2 , 0 , 1 , j48 ; do unt. const., var.
1 , 0 , 1 , j50 ; do unt. gen.
f44: 2 , 0 , 1 , j46 ; do step const., var.
1 , 0 , 1 , j47 ; do step gen.
1 , 0 , 1 , j0 ; data star
1 , 0 , 1 , j36 ; data slash
1 , 0 , 1 , j0 ; multiple equal
1 , 0 , 1 , j57 ; impl. equal
\f
; fortran, pass 5, page 42
1 , 0 , 1 , j56 ; do equal
f45: 10 , 0 , 1 , j0 ; arithm.equal,lt,...,not
2 , 0 , 3 , j18 ; beg. form. (cl.,op.)
1 , 0 , 1 , j99 ; not used
1 , 0 , 1 , j24 ; goto
4 , 0 , 1 , j0 ; if,...,stop
2 , 0 , 1 , j23 ; read, write
1 , 0 , 1 , j16 ; correct do term.
1 , 0 , 1 , j17 ; errorn.do term.
1 , 0 , 1 , j22 ; arit. left parent.
1 , 0 , 1 , j25 ; end call
f46: 1 , 0 , 1 , j0 ; spark
1 , 0 , 1 , j19 ; arit. right parent.
1 , 0 , 1 , j21 ; io right parent.
1 , 0 , 1 , j19 ; impl. right parent.
1 , 0 , 1 , j24 ; end if-expr.
1 , 0 , 1 , j40 ; vanished operand
5 , 0 , 1 , j21 ; end sim.goto,...,end log if
1 , 0 , 1 , j34 ; end data
1 , 0 , 1 , j41 ; end do
1 , 0 , 1 , j42 ; end io
f47: 19 , 0 , 1 , j99 ; not used
1 , 0 , 0 , j13 ; gen. common list
1 , 0 , 0 , j12 ; zone common list
1 , 0 , 3 , j11 ; com.var.in data stm.
1 , 0 , 0 , j10 ; loc. entry point list
1 , 0 , 0 , j9 ; external list
1 , 0 , 0 , j44 ; label variable list
1 , 0 , 2 , j43 ; length(s.l.v.,s.f.p.)
1 , 0 , 3 , j7 ; length(loc.arr.,zones)
2 , 0 , 4 , j7 ; decl.(loc. and com. arr.)
1 , 0 , 0 , j7 ; decl.(formal array)
f48: 1 , 0 , 9 , j7 ; decl.(loc. zone)
1 , 0 , 4 , j7 ; decl.(common zone)
1 , 0 , 5 , j7 ; decl.(formal zone)
5 , 0 , 1 , j99 ; not used
1 , 0 , 3 , j7 ; ext. zone decl.
8 , 0 , 1 , j99 ; not used
8 , 0 , 2 , j1 ; simple local
8 , 0 , 3 , j1 ; simple common
8 , 0 , 2 , j1 ; simple param
8 , 0 , 0 , j1 ; array (loc.,com.,par.)
8 , 0 , 3 , j1 ; zone(arr)(loc.,com.,par.)
24 , 0 , 2 , j1 ; external, ext. param.,ep name
f49: 8 , 0 , 3 , j1 ; stm.fct.call
8 , 0 , 7 , j1 ; stm.fct. descr.
8 , 0 , 4 , j1 ; simple equiv. to arr.
8 , 0 , 5 , j1 ; simple equiv. to zone
8 , 0 , 0 , j1 ; array equiv. to zone
8 , 0 , 1 , j1 ; common name
8 , 0 , 2 , j1 ; label var. descr.
8 , 0 , 1 , j1 ; trouble descr.
206 , 0 , 1 , j99 ; not used
1535 , 0 , 1 , j35 ; ident.no. in data-stm.
0 , 0 , 1 , j99 ; not used
\f
; fortran, pass 5, page 43
w. ; global constants
f1: 0 ; fwa, global entry point list
f2: 0 ; lwa, global entry point list
f3: 0 ; fwa, local entries
f4: 0 ; lwa, local entries
f5: 0 ; fwa, label table
f6: 0 ; lwa, label table
f52: 0 ; addr of last used label-entry
f7: 0 ; length, input-output record
f8: 0 ; fwa , input-output record
f9: 0 ; action, input record
f10: 0 ; first free word
f11: 0 ; last free word
f12: 0 ; fba, error labels and nulls
f13: 0 ; lba, error labels and nulls
f14: 0 ; upperpointer, data buffer
f15: 0 ; lowerpointer, data buffer
0 ; lwa, data buffer
f16: 0 ; fba, stack
f17: 0 ; lba, stack
f18: 0 ; fba, general common list
f19: 0 ; lba, general common list
f20: 0 ; fba, zone common list
f21: 0 ; lba, zone common list
f22: 0 ; fba, com. var. in data stm.
f23: 0 ; lba, com. var. in data stm.
f24: 0 ; fba, local entry point list
f25: 0 ; lba, local entry point list
f26: 0 ; fba, external list
f27: 0 ; lba, external list
f28: 0 ; fba, label variable list
f29: 0 ; lba, label variable list
f30: 0 ; special
f31: 0 ; implied equal
f32: 0 ; no. of classes * 4
h.f33: 0, r. 14 ; new records
f34: 0, r. 5 ; troublerecord,<trouble int. descr.>
w.f35: 0 ; data
f36: 0 ; <no.of bytes> - record
f37: 0 ; format label declaration
f38: 0 ; trouble
f39: -2 ; mask
w.f50: 0 ; subscripted
f51: 0, r. 6 ; integer table
h.f53: 0, r. 3 ; <no. of labels, globals>
w.f54: 0 ; datagroup no.
; f55 , see action c10
\f
; fortran, pass 5, page 44
b. a4 ; action 33
; if trouble is true, the action is skipped.
; if implied equal is true, the <implied do> - record is
; output, and implied equal is set to false.
; the <io comma> - record is output.
w.
c33: al w1 0 ; begin
se. w1 (f38.) ; if not trouble then
jl. a4. ; begin
sn. w1 (f31.) ; if impl. equal then
jl. a2. ; begin
rs. w1 f31. ; impl. equal:=false
al w0 1 ;
al. w1 4 + f33. ; outrec(1,<impl.do>)
jl. w3 d5. ; end
a2: dl. w1 f8. ; outrec(1,<io comma>)
jl. w3 d5. ; end
a4: jl. d1. ; end
e.
b. a2 ; action 34
; trouble is set to false, data is set to true, and the lower -
; as well as the upperpointer of the databuffer are reset.
; the datagroup no. is increased by one.
; the constants of the datagroup and the <data slash> -
; record are input, and the constants are stored in the data
; buffer.
w.
c34: al w0 0 ; begin
rs. w0 f38. ; trouble := false
rl. w0 f54. ;
ba. w0 1 ; datagroupno. :=
rs. w0 f54. ; datagroupno. + 1
al w0 1 ; data := true
rs. w0 f35. ; if lwa-databuffer = 0
rl. w1 2 + f15. ; then
sn w1 0 ; lwa-databuffer:=lwa
rl. w1 f11. ; lowerpointer :=
rs. w1 2 + f15. ; upperpointer :=
rs. w1 f14. ; lwa - databuffer
rs. w1 f15. ;
a2: rl. w1 f8. ; for i := 1 step 1
jl. w3 d3. ; while
rl. w3 f9. ; rec <> <data slash>
sn w3 j36 ; and
jl. +6 ; rec <> <trouble>
se w3 j39 ; and
sn w3 j40 ; rec <> <van. op.> do
jl. d2. ; bufin(inrec)
dl. w1 f8. ; comment: <data slash>
jl. w3 d16. ; has been read.
jl. a2. ; end
jl. d1. ; comment: read next rec.
e.
\f
; fortran, pass 5, page 45
b. a14, b3 ; action 35
; if trouble is true, the <vanished operand> - record is
; output.
; if trouble is false, commonsearch is called.
; if the identifier is a simple variable, the <spark> - record,
; a constant and the <arithm. equal> - record are output.
; if the identifier is a subscripted variable, <spark>, the constant
; and the <arithm. equal> - record have allready been output.
; if the identifier is an array, <spark> and a number of constans corre-
; sponding to the number of elements in the array is output,
; followed by the <data init.> - record. before each constant-
; group, the <array data> - record is output.
; finally subscripted is set to false, and the variable -
; description is output, and the next record is input.
; if this record is the <spark> - record, <spark>, one constant and
; the <arithm. equal> - record are output, and subscripted is
; set to true.
w. b1: 0 ; no
b2: 0 ; length
b3: 0 ; description
c35: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a14. ; begin
bl. w0 (f8.) ; commonsearch
jl. w3 d20. ; (ident. no.; array,
rs. w1 b1. ; no, length, descr.)
ds. w3 b3. ;
am. (f50.) ; if subscripted then
se w1 x1 0 ; goto a10
jl. a10. ;
sn w0 0 ; if not array then
jl. a6. ; goto a6
a2: al w0 1 ; comment: array
al. w1 1 + f46. ; outrec(1,
jl. w3 d5. ; <spark>)
a3: al w0 1 ;
al. w1 1 + f33. ; outrec(1,
jl. w3 d5. ; <array data>)
rl. w0 b1. ; outconst(no; del)
jl. w3 d19. ;
sl. w0 (b1.) ; if del = no then
jl. a4. ; goto a4
\f
; fortran, pass 5, page 46
rl. w1 b1. ;
ws w1 0 ; no := no - del
rs. w1 b1. ;
rl. w1 f54. ;
ba. w0 3 ; if del > 0 then
sn w0 1 + e86 ; goto a3
jl. d18. ; if del = 0 then
jl. a3. ; error(1+e86,datagroupno.)
a4: al w0 1 ;
al. w1 2 + f33. ; outrec(1,
jl. w3 d5. ; <data init>)
jl. a10. ; goto a10
a6: al w0 1 ; comment: simple var.
al. w1 1 + f46. ; outrec(1,
jl. w3 d5. ; <spark>)
al w0 1 ;
jl. w3 d19. ; outconst(1; del)
rl. w1 f54. ;
ba. w0 3 ; if del = 0 then
sn w0 1 + e86 ;
jl. d18. ; error(1+e86,datagroupno.)
al w0 1 ;
al. w1 1 + f45. ; outrec(1,
jl. w3 d5. ; <arithm. equal>)
a10: al w0 0 ; subscripted :=
rs. w0 f50. ; false
dl. w1 b3. ; outrec(length,
jl. w3 d5. ; <description>)
rl. w1 f8. ;
jl. w3 d3. ; inrec(record)
al w2 j0 ; if record =
se. w2 (f9.) ; <spark> then
jl. a12. ; begin
al w0 1 ; outrec(1,
al. w1 1 + f46. ; <spark>)
jl. w3 d5. ;
al w0 1 ; subscripted :=
rs. w0 f50. ; true
jl. w3 d19. ; outconst(1; del)
rl. w1 f54. ;
ba. w0 3 ; if del = 0 then
sn w0 1 + e86 ; error(1+e86,datagroupno.)
jl. d18. ; <arithm. equal>)
al w0 1 ;
al. w1 1 + f45. ; end
jl. w3 d5. ; goto action
a12: jl. d2. ; end
a14: al. w1 21 + f46. ; outrec(1,
jl. w3 d5. ; <vanished operand>)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 47
b. a4 ; action 36
; if trouble is false,
; the lba and the fba of the empty stack (for <end list> -
; records in data statements) are calculated.
; the next record is read, and if this is the <spark> -
; record, subscripted is set to true, the <spark>,
; the next constant and the <arithm. equal> - record are output.
w.
c36: al w1 1 ; begin
sn. w1 (f38.) ; if not trouble then
jl. a4. ; begin
wa. w1 f11. ; lba - stack :=
rs. w1 f17. ; lfw + 1
al w1 x1 1 ; fba - stack :=
rs. w1 f16. ; lba + 1
rl. w1 f8. ; inrec(record)
jl. w3 d3. ;
al w0 0 ; subscripted :=
rs. w0 f50. ; false
al w1 j0 ; if rec=<spark> then
se. w1 (f9.) ; begin
jl. a2. ;
al w0 1 ;
al. w1 1 + f46. ; outrec(1,<spark>)
jl. w3 d5. ; subscripted :=
al w0 1 ; true
rs. w0 f50. ; outconst(1, del)
jl. w3 d19. ;
rl. w1 f54. ; if del = 0 then
ba. w0 3 ; error(1+e86,datagroupno.)
sn w0 1 + e86 ; outrec(1,
jl. d18. ; <arithm. equal>)
al w0 1 ;
al. w1 1 + f45. ; end
jl. w3 d5. ; goto action
a2: jl. d2. ; end
a4: jl. d1. ; end
e.
b. ; action 37
; if the databuffer is not empty, error(1 + e86) is called.
w.
c37: al w0 1 + e86 ; begin
rl. w1 f54. ;
rl. w2 f14. ; if not empty buffer
se. w2 (f15.) ; then
jl. d18. ; error(1+e86,datagroupno.)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 48
b. ; action 38
; if trouble is false, the <mon. minus> - record is output.
w.
c38: dl. w1 f8. ; begin
se. w0 (f38.) ; if not trouble then
jl. w3 d5. ; outrec(1,<mon. min>)
jl. d1. ; end
e.
b. ; action 39
; trouble is set to true, and the <trouble> - record is output.
w.
c39: al w0 1 ; begin
rs. w0 f38. ; trouble := true
dl. w1 f8. ; outrec
jl. w3 d5. ; (length, trouble)
jl. d1. ; end
e.
b. ; action 40
; if trouble is true, the <vanished operand>-record is output.
w.
c40: al w0 1 ; begin
al. w1 21 + f46. ; if trouble then
sn. w0 (f38.) ; outrec(1,<van. op.>)
jl. w3 d5. ;
jl. d1. ; end
e.
\f
; fortran, pass 5, page 49
b. a2 ; action 41
; special is set to true, and an element is taken from the stack.
; if this element is false, the <trouble> - record no. e86+0 is
; output, and the following records until the <lab.ref.> - record
; (or until a <trouble> - record) are skipped. trouble is set to true.
; if the stackelement is true, the <end do> - record is output.
w.
c41: al w0 1 ; begin
rs. w0 f30. ; spec := true
jl. w3 d9. ;
sn w3 0 ; if unstack then
jl. a1. ; outrec(length, <end do>)
dl. w1 f8. ; else
jl. w3 d5. ;
jl. d1. ; begin
a1: al w0 1 ; trouble :=
rs. w0 f38. ; true
al w0 0 + e86 ;
al. w1 f34. ;
hs w0 x1 +1 ; outrec(4,
al w0 4 ; troublerec. no. e86+0)
jl. w3 d5. ;
rl. w1 f8. ; for i := 1 step 1
bl. w0 9 + f42. ;
bl. w2 25 + f41. ; while
a2: jl. w3 d3. ; rec <> <stm.lab.> and
bl w3 x1 +0 ; rec <> <trouble> do
se w2 x3 +0 ; inrec(record)
sn w0 x3 +0 ;
jl. d2. ; end
jl. a2. ; end
e.
b. ; action 42
; the <end io> - and the <io comma> - record are output.
w.
c42: dl. w1 f8. ; begin
jl. w3 d5. ; outrec(length,<end io>)
al w0 1 ;
al. w1 41 + f42. ;
jl. w3 d5. ; outrec(1,<io comma>)
jl. d1. ; end
e.
b. ; action 43
; the <no. of bytes for simple local variables and stm. fct.
; param.> - record is stored.
w.
c43: rl. w0 (f8.) ; begin
rs. w0 f36. ; no.of bytes := record
jl. d1. ; end
e.
\f
; fortran, pass 5, page 50
b. a2 ; action 44
; the <label variable list> is stored, and the fba and the
; lba are calculated.
; the lfw is recalculated.
w.
c44: rl. w1 f7. ; begin
rl. w2 f11. ;
al w2 x2 1 ; lba - label var. list :=
rs. w2 f29. ; 1 + lfw
ws w2 3 ;
al w2 x2 1 ; fba :=
rs. w2 f28. ; lba - length + 1
al w2 x2 -2 ; lwa :=
la. w2 f39. ; (fba - 2) and mask
rs. w2 f11. ;
a2: am. (f8.) ;
bl w0 x1 -1 ; for i := length
am. (f28.) ; step -1 until 1 do
hs w0 x1 -1 ;
al w1 x1 -1 ; list(i) :=
se w1 0 ; record(i)
jl. a2. ;
jl. d1. ; end
e.
b. ; action 46
; if trouble is false, integersearch is called.
w.
c46: am. (f38.) ; begin
sn w1 x1 0 ; if not trouble then
jl. w3 d15. ; integersearch
jl. d1. ; end
e.
b. ; action 47
; special is set to false.
w.
c47: al w0 0 ; begin
rs. w0 f30. ; spec := false
jl. d1. ; end
e.
\f
; fortran, pass 5, page 51
b. a2 ; action 48
; if trouble is false the <do step> - record is output, and
; integersearch is called.
w.
c48: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 12 + f33. ; outrec(1,<do step>)
jl. w3 d5. ; integersearch
jl. w3 d15. ; end
a2: jl. d1. ; end
e.
b. a2 ; action 49
; if trouble is false the <impl. step> - record is output,
; and integersearch is called.
w.
c49: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 8 + f33. ; outrec(1,<impl.step>)
jl. w3 d5. ; integersearch
jl. w3 d15. ; end
a2: jl. d1. ; end
e.
b. a2 ; action 50
; if trouble is false, the <do step> - record is output, and
; special is set to false.
w.
c50: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 12 + f33. ; outrec
jl. w3 d5. ; (1,<do step>)
al w0 0 ; spec := false
rs. w0 f30. ; end
a2: jl. d1. ; end
e.
\f
; fortran, pass 5, page 52
b. a2 ; action 51
; if trouble is false the <impl. step> - record is output,
; and special is set to false.
w.
c51: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 8 + f33. ; outrec
jl. w3 d5. ; (1,<impl. step>)
al w0 0 ; spec := false
rs. w0 f30. ; end
a2: jl. d1. ; end
e.
b. a2 ; action 52
; if trouble is false the <do unt.> - record is output, and
; integersearch is called.
w.
c52: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 11 + f33. ; outrec(1,<do unt.>)
jl. w3 d5. ; integersearch
jl. w3 d15. ; end
a2: jl. d1. ; end
e.
b. a2 ; action 53
; if trouble is false the <impl. unt.> - record is output,
; and integersearch is called:
w.
c53: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 7 + f33. ; outrec(1,<impl. unt.>)
jl. w3 d5. ; integersearch
jl. w3 d15. ; end
a2: jl. d1. ; end
e.
\f
; fortran, pass 5, page 53
b. a2 ; action 54
; if trouble is false the <do unt.> - record is output, and
; special is set to false.
w.
c54: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 11 + f33. ; outrec
jl. w3 d5. ; (1,<do unt.>)
al w0 0 ; spec := false
rs. w0 f30. ; end
a2: jl. d1. ; end
e.
b. a2 ; action 55
; if trouble is false the <impl. unt.> - record is output,
; and special is set to false.
w.
c55: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 7 + f33. ; outrec
jl. w3 d5. ; (1,<impl. unt.>)
al w0 0 ; spec := false
rs. w0 f30. ; end
a2: jl. d1. ; end
e.
b. a2 ; action 56
; if trouble is true, this action is skipped.
; contrary the <do init. spec.> - or the <do init. gen.> -
; record is output, when special is true and false,
; respectively.
; the no. of globals is increased by (2 - special).
w.
c56: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; outrec(1,
al. w1 9 + f33. ; if spec then
se. w0 (f30.) ; <do init spec>
al. w1 10 + f33. ; else
jl. w3 d5. ; <do init gen>
bl. w1 2 + f53. ;
al w1 x1 +1 ; no. of globals :=
; no. of globals + 1;
hs. w1 2 + f53. ;
a2: jl. d1. ; end
e.
\f
; fortran, pass 5, page 54
b. a2 ; action 57
; if trouble is true, this action is skipped.
; contrary implied equal is set to true, and the <impl. init.
; spec.> - or the <impl. init. gen.> - record is output,
; when special is true and false, respectively.
; the no. of globals is increased by 2.
w.
c57: al w0 1 ; begin
sn. w0 (f38.) ; if not trouble then
jl. a2. ; begin
al. w1 5 + f33. ; outrec(1,
se. w0 (f30.) ; if spec
al. w1 6 + f33. ; then <impl.init.spec.>
jl. w3 d5. ; else <impl.init.gen.>
al w0 1 ; impl. equal := true
rs. w0 f31. ;
bl. w1 2 + f53. ; no. of globals :=
al w1 x1 +1 ; no. of globals + 1
hs. w1 2 + f53. ; end
a2: jl. d1. ; end
e.
b. b1 ; action 99
; after the message:
; <bytevalue> unknown record to pass 5
; the translation is terminated.
w. b1: <: unknown record to pass 5<0>:>
c99: bz. w0 (f8.) ; begin
jl. w3 g10. ;
32<12 + 5 ; print(bytevalue)
al. w1 b1. ; print(unknown record)
jl. g5. ; terminate translation
; end
e.
\f
; fortran, pass 5, page 55
; assignments to the elements of the action table:
j0 = c0 - i0, j20 = c20 - i0, j40 = c40 - i0,
j1 = c1 - i0, j21 = c21 - i0, j41 = c41 - i0,
j2 = c2 - i0, j22 = c22 - i0, j42 = c42 - i0,
j3 = c3 - i0, j23 = c23 - i0, j43 = c43 - i0,
j4 = c4 - i0, j24 = c24 - i0, j44 = c44 - i0,
j5 = c5 - i0, j25 = c25 - i0,
j6 = c6 - i0, j46 = c46 - i0,
j7 = c7 - i0, j47 = c47 - i0,
j8 = c8 - i0, j48 = c48 - i0,
j9 = c9 - i0, j49 = c49 - i0,
j10 = c10 - i0, j50 = c50 - i0,
j11 = c11 - i0, j51 = c51 - i0,
j12 = c12 - i0, j52 = c52 - i0,
j13 = c13 - i0, j33 = c33 - i0, j53 = c53 - i0,
j14 = c14 - i0, j34 = c34 - i0, j54 = c54 - i0,
j15 = c15 - i0, j35 = c35 - i0, j55 = c55 - i0,
j16 = c16 - i0, j36 = c36 - i0, j56 = c56 - i0,
j17 = c17 - i0, j37 = c37 - i0, j57 = c57 - i0,
j18 = c18 - i0,
j19 = c19 - i0, j39 = c39 - i0, j99 = c99 - i0,
b. a10, b3 ; proc inrec
; (record;length,action)
; the procedure inrec reads the next record, and it finds
; its length and action.
; if the record is <end line>, <end statement>, <ext. ident.>,
; or <label decl.> the appropriate action is performed, and
; the next record is input.
; if the size of the record exceeds the size of the free core
; store, stackerror is called.
; it is called from the head, and from action 11, 34, 35, 36, 41
; and integersearch in this way:
;
; al. w1 <addr.,proposed>.
; jl. w3 d3.
; it is noticed, that if a declaration of a new label is
; input, the proposed startaddress is altered due to the
; growth of the label table.
w. b0: 0 ; w0 - store
b1: 0 ; w1 - store
b2: 0 ; w2 - store
b3: 0 ; w3 - store
\f
; fortran, pass 5, page 56
d3: ds. w1 b1. ; begin
ds. w3 b3. ;
a2: jl. w3 g2. ; record(0) :=
hs. w2 (b1.) ; inbyte
al w0 x2 0 ; find
jl. w3 d12. ; (record(0);no,action)
rs. w1 f9. ;
al w1 0 ; i := 0
se w0 0 ; if no = 0 then
jl. a4. ;
al w1 1 ; begin
jl. w3 g2. ; i := 1
am. (b1.) ; record(1) := inbyte
hs w2 +1 ; no := 2 + record(1)
al w0 x2 +2 ; end
a4: rs. w0 f7. ; length := no
rx w0 2 ;
al w3 x1 -2 ;
wa. w3 b1. ;
sl. w3 (f11.) ; if rec. + length - 2
jl. d7. ; > lwa then stackerror
a6: al w1 x1 -1 ;
sh w1 (0) ;
jl. a8. ; for j := length - 1
jl. w3 g2. ; step -1
am. (b1.) ; while j>i do
hs w2 x1 0 ; record(j) := inbyte
jl. a6. ;
a8: rl. w1 f9. ; if <end line> or
sl w1 j2 ; <end stm > or
sl w1 1 + j5 ; <ext. ident.> or
jl. a10. ; <label decl.> then
jl. x1 i0. ; begin
d4: rl. w3 f8. ;
rs. w3 b1. ; action
jl. a2. ;
a10: dl. w1 b1. ; goto a2
dl. w3 b3. ; end
jl x3 +0 ; end
e.
\f
; fortran, pass 5, page 57
b. a2, b3 ; proc outrec
; (length,record)
; the procedure outrec, which outputs a record, is called
; from most actions in this way:
;
; al w0 <no. of bytes>
; al. w1 <startaddress>.
; jl. w3 d5.
w. b2: 0 ; w2 - store
b3: 0 ; w3 - store
d5: ds. w3 b3. ; begin
rl w2 0 ;
a2: al w2 x2 -1 ;
am x2 0 ; for i := length - 1
bl w0 x1 0 ; step -1 until 0 do
jl. w3 g3. ; outbyte(record(i))
se w2 0 ;
jl. a2. ;
rl. w2 b2. ;
jl. (b3.) ; end
e.
b. a4, b5 ; proc labelsearch
; (lab, counter)
; a search for the label is performed through the label table.
; if the label is not found, the label is added to the table,
; and the 4 counters are reset; the fwa of the inout - record
; is increased by 6. if the counter is equal to 2 or 3 (i.e.
; a label reference), the no. of globals is increased by 1.
; the counter is increased by 1, and the label no. is output.
; if trouble is true, the <vanished operand> - record is out-
; put instead of the label no.
; the procedure is called from action 5, 14, and 15 in this
; way:
;
; rl. w0 <label addr.>.
; al w1 <counter>
; jl. w3 d6.
;
; where <counter> := 0 (declared statement label) or
; 1 (declared format label) or
; 2 (referred statement label) or
; 3 (referred format label)
w. b0: 0 ; w0 - store
b1: 0 ; w1 - store
b2: 0 ; w2 - store
b3: 0 ; w3 - store
b4: 6 ;
h. b5: 0 ; label no.
\f
; fortran, pass 5, page 58
w.
d6: ds. w1 b1. ; begin
ds. w3 b3. ;
rl. w2 f5. ; for i := 1 step 1
a2: sl. w2 (f6.) ; until n do
jl. a3. ;
sn w0 (x2 +0) ;
jl. a4. ; if label(i) = lab
al w2 x2 +6 ; then goto a4
jl. a2. ;
a3: rs w0 x2 +0 ; label(i) := lab
al w3 x2 +4 ; lwa - label table :=
rs. w3 f6. ; lwa + 6
al w3 x3 2 ; fwa - inoutrecord :=
rs. w3 f8. ; 2 + lwa-labeltable
al w0 0 ;
rs w0 x2 +2 ; ds(i) := df(i) :=
rs w0 x2 +4 ; rs(i) := rf(i) := 0
sh w1 1 ; if counter = 2 or
jl. a4. ; counter = 3 then
bl. w1 2 + f53. ; no. of globals :=
al w1 x1 +1 ; no. of globals + 1
am. (f38.) ; (unless trouble)
sn w1 x1 ;
hs. w1 2 + f53. ;
a4: am. (b1.) ;
al w3 x2 +2 ;
rs. w2 f52. ; save addr of label-entry;
al w0 1 ; counter(i) :=
ba w0 x3 0 ; counter(i) + 1
sh w0 2047 ; (unless overflow)
hs w0 x3 0 ;
ws. w2 f5. ;
al w1 0 ; label no. :=
wd. w2 b4. ; 511 + i
al w2 x2 512 ;
hs. w2 b5. ;
al w0 1 ;
al. w1 b5. ; outrec(length,
am. (f38.) ; if trouble
se w1 x1 0 ; then <van. op.>
al. w1 21 + f46. ; else <label no.>)
jl. w3 d5. ;
rl. w2 b2. ;
jl. (b3.) ; end
e.
b. b1 ; proc stackerror
; after the message: process too small, the translation is terminated.
; if the size of the free core store is too small, this pro-
; cedure is called from inrec, tabelsearch, action 9, 10, 11, 12,
; and 13 in this way:
;
; jl. d7.
w. b1: <:<10>process too small<0>:>
; begin
d7: al. w1 b1. ; print(process too small)
jl. g5. ; terminate translation
; end
e.
\f
; fortran, pass 5, page 59
b. b0 ; proc stack(byte)
; the byte is stacked, and the address of the last free word
; is recalculated.
; the procedure is called from action 16, 17, 19, 20, 21 and 25
; in this way:
;
; bl. w0 <byte addr.>.
; jl. w3 d8.
w. b0: 0 ; return address
d8: rs. w3 b0. ; begin
rl. w3 f16. ;
al w3 x3 -1 ; fba := fba - 1
rs. w3 f16. ;
hs w0 x3 0 ; stack(fba) := byte
al w3 x3 -2 ;
la. w3 f39. ; lwa :=
rs. w3 f11. ; (fba - 2) and mask
jl. (b0.) ; end
e.
b. b0 ; proc unstack(byte)
; a byte is unstacked, and the address of the last free word
; is recalculated.
; the procedure is called from action 22, 23, 24, and 41 in
; this way:
;
; jl. w3 d9. ;
; ; (w3) = byte
w. b0: 0 ; return address
d9: rs. w3 b0. ; begin
rl. w3 f16. ;
al w3 x3 +1 ; fba := fba + 1
rs. w3 f16. ;
al w3 x3 -2 ;
la. w3 f39. ; lfw :=
rs. w3 f11. ; (fba - 2) and mask
am. (f16.) ;
bl w3 -1 ; byte := stack(fba - 1)
jl. (b0.) ; end
e.
\f
; fortran, pass 5, page 60
b. a8, b9 ; proc listsearch
; (fba,lba,dist,ident)
; listsearch searches for the ident no. in the bytes:
; fba, fba + dist, fba + 2*dist,..., lba.
; if the ident no. is not found, listsearch is set to false.
; contrary listsearch is set to true, and the external repre-
; sentation is stored into 8 bytes, the first byte being
; ident; if the external representation is longer than 11
; characters, it is shortened to this length; if it is shor-
; ter than 11 characters, the last positions are filled with
; zeroes.
; it is called from action 4 in this way:
;
; input output
;
; w0: dist, ident ident
; w1: fba listsearch
; w2: lba undefined
; w3: return address undefined
w. b1: 0 ; i
b2: 0 ; lba
b3: 0 ; return address
b4: 0 ; ident. no.
b5: 0 ; dist
b8: 8.77777400 ;
b9: 0 ; 1 + no.of bytes
\f
; fortran, pass 5, page 61
d10: hs. w0 1 + b4. ; begin
ls w0 -12 ;
rs. w0 b5. ;
ds. w2 b2. ; for i := fba
rs. w3 b3. ; step dist
rl. w0 b4. ; until lba do
a2: sh. w1 (b2.) ; begin
jl. +4 ;
jl. a7. ;
bl w2 x1 +7 ;
bl w1 x1 +0 ;
sn w0 x1 0 ; if (i) = ident
se w2 1 ; and entry contains an ident no then
jl. a5. ; begin
am. (f8.) ;
bl w2 +1 ; for j := 1
rs. w2 b9. ; step 1 until 8 do
al w2 1 ;
a4: am. (f8.) ;
bl w0 x2 +1 ;
sl. w2 (b9.) ; i(j) :=
al w0 0 ; if j > no.of bytes
am. (b1.) ; then 0
hs w0 x2 -1 ; else ident(j)
al w2 x2 +1 ;
sh w2 8 ;
jl. a4. ;
la. w0 b8. ;
am. (b1.) ; i(8) := i(8) and
hs w0 x2 -2 ; 2.00000000
al w1 1 ;
jl. a8. ; end
a5: rl. w1 b1. ;
wa. w1 b5. ;
rs. w1 b1. ; i := i + dist
jl. a2. ; end
a7: al w1 0 ; listsearch := false
a8: rl. w0 b4. ;
jl. (b3.) ; end
e.
\f
; fortran, pass 5, page 62
b. a18, b6 ; proc tablesearch
; this procedure performs 3 searches through the label table,
; for not declared labels, for multiple declared labels, and
; for declared but not referred labels (nulls).
; if such labels occur, the corresponding list is formed and
; output.
; if the free core store is exceeded when forming a list,
; stackerror is called.
; the procedure is called from action 8 in this way:
;
; jl. w3 d11.
w. b0: 0 ; w0 - store
b1: 0 ; w1 - store
b2: 0 ; w2 - store
b3: 0 ; w3 - store
b5: 6 ;
b6: 0 ; 2 * list no.
; begin
a2: bl w2 x1 +2 ; proc not decl. label
se w2 0 ; begin
jl. 8 ;
bl w2 x1 +4 ;
sl w2 1 ; not decl. label :=
jl. a14. ; if
bl w2 x1 +3 ; (ds(i) = 0 and
se w2 0 ; rs(i) > 0) or
jl. a16. ; (df(i) = 0 and
bl w2 x1 +5 ; rf(i) > 0)
sl w2 1 ; then true
jl. a14. ; else false
jl. a16. ; end
a4: bl w2 x1 +2 ; proc mult. decl. label
ba w2 x1 +3 ; begin
sh w2 1 ; mult. decl. label :=
jl. a16. ; if ds(i)+df(i) > 1
jl. a14. ; then true else false
; end
; proc null
a6: rl w3 x1 +4 ; begin
sn w3 0 ; null := if
jl. a14. ; rs(i)+rf(i) = 0
jl. a16. ; then true else false
; end
\f
; fortran, pass 5, page 63
d11: ds. w1 b1. ; comment: entry point
ds. w3 b3. ;
rl. w1 f6. ;
al w1 x1 +2 ; fba := 2 +
rs. w1 f12. ; lwa - label table
al w1 2 ;
rs. w1 b6. ; for list := 1, 2, 3 do
a10: rl. w1 f12. ; begin
al w1 x1 1 ;
rs. w1 f13. ; lba - list := fba + 1
rl. w1 f5. ; for i:=1 step 1 until n do
a12: sl. w1 (f6.) ; begin
jl. a17. ;
am. (b6.) ;
jl. +0 ; if (list=1 and n.d.l.) or
jl. a2. ; (list=2 and m.d.l.) or
jl. a4. ; (list=3 and null)
jl. a6. ; then
a14: rl. w2 f13. ; begin
al w2 x2 +1 ; lba := lba + 1
rs. w2 f13. ;
sl. w2 (f11.) ; if lba>lfw then
jl. d7. ; stackerror
al w3 x1 0 ; list(lba) :=
ws. w3 f5. ;
al w2 0 ;
wd. w3 b5. ; then 511 + i
al w3 x3 512 ;
hs. w3 (f13.) ; end
a16: al w1 x1 6 ;
jl. a12. ; end
a17: rl. w1 f12. ;
rl. w2 f13. ;
ws w2 2 ; if lba-fba-1 > 0 then
al w2 x2 -1 ;
sh w2 0 ;
jl. a18. ;
al w0 x2 2 ; begin
rl. w3 b6. ;
ls w3 -1 ; list(1):=lba-fba-1
ba. w3 9 + f48. ; list(0):=byte+list
hs w3 4 ; outrec
rs w2 x1 0 ; (list(1)+2,list)
jl. w3 d5. ; end
a18: rl. w1 b6. ;
al w1 x1 2 ;
rs. w1 b6. ;
sh w1 6 ;
jl. a10. ; end
dl. w1 b1. ;
dl. w3 b3. ;
jl x3 0 ; end
e.
\f
; fortran, pass 5, page 64
b. a2, b1 ; proc find
; (ident;no,action)
; the procedure, which is called from inrec and commonsearch,fetches
; from the inputclass-table the action and the length
; for the actual record identification.
; it is called in this way:
; bz. w0 <identbyte addr.>.
; jl. w3 d12.
; ; (w0) = no. of bytes
; ; (w1) = action
w.
b1: 0 ; returnaddress
d12: rs. w3 b1. ; begin
rl. w1 f32. ; class := no. of classes
a1: bz. w3 x1 1 + f40. ;
se w1 0 ; if class > 0 and
sl w0 x3 0 ; ident < base(class)
jl. a2. ; then
al w1 x1 -4 ; begin
jl. a1. ; class := class - 1
a2: bz. w0 x1 2 + f40. ; goto a1
bl. w1 x1 3 + f40. ; end
jl. (b1.) ; no := numb(class)
; act := action(class)
; end
e.
b. a6 ; proc initialize
; when initializing pass 5 the basevalue of each inputclass
; and the number of classes are calculated.
; then the addresses of the first free word and the last free
; word are calculated.
; a table of the new records is filled, and the leading byte
; for a troublerecord is set.
; the integer - table is filled with the bytevalues of integer-
; constant and simple integer - descriptions (local,
; common, parameter, equiv. to array, and equiv. to zone).
; the directionbyte of the <no. of labels - and the no. of
; globals> - record is set.
; finally the <end pass> - record is output.
;
; the procedure is called from the head program in this way:
;
; jl. d13. ; initialize
\f
; fortran, pass 5, page 65
w.
d13: al w3 0 ; begin
bl. w0 1 + f40. ;
a2: ba. w0 x3 f40. ; for i := 1 step 1
sn. w0 (x3 f40.) ; while no(i) > 0 do
jl. a4. ; basevalue(i + 1) :=
al w3 x3 4 ; basevalue(i) + no(i)
hs. w0 x3 1 + f40. ;
jl. a2. ;
a4: rs. w3 f32. ; no. of classes := i
jl. w3 g9. ; lfw :=
rs. w0 f11. ; last free word
al. w3 i25. ; fwa - glob.ep.list :=
rs. w3 f1. ; lwa - glob.ep.list :=
rs. w3 f2. ; first free word
al w3 x3 2 ; fwa - inout record :=
rs. w3 f8. ; ffw :=
rs. w3 f10. ; first free word + 2
al w1 0 ;
a6: al w2 x1 136 ; for i := 0
hs. w2 x1 f33. ; step 1 until 13 do
al w1 x1 1 ;
sh w1 13 ; table(i) := 136 + i
jl. a6. ;
bl. w0 9 + f42. ;
hs. w0 f34. ; troublerecord
bl. w1 13 + f41. ; inttab(0) :=
rs. w1 0 + f51. ; <int. constant>
bl. w1 25 + f48. ;
al w1 x1 2 ; inttab(1) :=
rs. w1 2 + f51. ; <simple loc. int. var.>
bl. w1 29 + f48. ;
al w1 x1 2 ; inttab(2) :=
rs. w1 4 + f51. ; <simple com. int. var.>
bl. w1 33 + f48. ;
al w1 x1 2 ; inttab(3) :=
rs. w1 6 + f51. ; <simple par. int. var.>
bl. w1 9 + f49. ;
al w1 x1 2 ; inttab(4) :=
rs. w1 8 + f51. ; <sim.int.var.equiv.arr.>
al w1 x1 8 ; inttab(5) :=
rs. w1 10 + f51. ; <sim.int.var.equiv.zone>
bl. w1 13 + f48. ;
al w1 x1 +4 ; <no. of labels, globals> :=
hs. w1 f53. ; directionbyte
al w0 1 ;
al. w1 21 + f40. ; outrec
jl. w3 d5. ; (1, <end pass>)
jl. d1. ; end
e.
\f
; fortran, pass 5, page 66
b. a8, b3 ; proc bufback
; (record, length)
; the record and the recordlength are replaced in the bottom
; of the (perhaps empty) databuffer.
; the lowerpointer (pointing at the record in the buffer) is
; increased by (1 + the recordlength).
; the procedure is called from outconst in this way:
;
; al w0 <no. of bytes>
; al. w1 <startaddress>.
; jl. w3 d14.
w. b0: 0 ; length
b1: 0 ; startaddress
b3: 0 ; returnaddress
d14: ds. w1 b1. ; begin
rs. w3 b3. ;
sh w0 0 ;
jl. a8. ; if upperpointer =
ba. w0 1 ; lowerpointer
rl. w1 f15. ; then
se. w1 (f14.) ; upperpointer :=
jl. a2. ; upperpointer
ws w1 0 ; - length - 1
rs. w1 f14. ; else
jl. a4. ; lowerpointer :=
a2: wa w1 0 ; lowerpointer
rs. w1 f15. ; + length + 1
a4: rl. w1 f15. ;
ws. w1 b0. ; for i := 1 step 1
al w3 0 ; until length do
a6: am. (b1.) ; databuffer(i +
bl w0 x3 +0 ; lowerpointer
am x1 +0 ; - length - 1) :=
hs w0 x3 +0 ; record(i)
al w3 x3 +1 ;
se. w3 (b0.) ; databuffer
jl. a6. ; (lowerpointer) :=
hs. w3 (f15.) ; length
a8: jl. (b3.) ; end
e.
b. a4, b3 ; proc integersearch
; the next record, which is a constant or a simple variable
; description, is read and written.
; if this record was neither an integer constant nor an inte-
; ger variable (local, common, parameter, equiv. to array,
; equiv. to zone), special is set to false.
; this procedure is called from action 46, 48, 49, 52, and 53
; in this way:
;
; jl. w3 d15.
w. b0: 0 ; w0 - store
b1: 0 ; w1 - store
b3: 0 ; return address
\f
; fortran, pass 5, page 67
d15: ds. w1 b1. ; begin
rs. w3 b3. ;
rl. w1 f8. ; inrec(record;length)
jl. w3 d3. ;
dl. w1 f8. ; outrec(length,record)
jl. w3 d5. ;
bl. w1 (f8.) ;
al w3 10 ; if (rec<>int.const. and
a2: al w3 x3 -2 ; rec<>s.loc.int.v.and
sn. w1 (x3 f51.) ; rec<>s.com.int.v.and
jl. a4. ; rec<>s.i.param. and
se w3 0 ; rec<>s.i.v.eq.ar.and
jl. a2. ; rec<>s.i.v.eq.z.)then
rs. w3 f30. ; spec := false
a4: dl. w1 b1. ;
jl. (b3.) ; end
e.
b. a4, b1 ; proc bufin(record,length)
; the recordlength and the record are put into the databuffer.
; the upperpointer (pointing at the first free byte of the
; buffer) is decreased by (1 + the recordlength), and the
; lwa is recalculated.
; the procedure is called from action 34 and outconst in this way:
;
; al w0 <no. of bytes>
; al. w1 <start address>.
; jl. w3 d16.
w. b0: 0 ; length
b1: 0 ; startaddress
d16: sh w0 0 ; begin
jl. a4. ; if length > 0 then
ds. w1 b1. ; begin
ba. w0 1 ; upperpointer :=
ac w0 (0) ; upperpointer
wa. w0 f14. ; - length - 1
rs. w0 f14. ; lwa :=
bs. w0 1 ;
la. w0 f39. ; (upperpointer-1) and mask
rs. w0 f11. ;
al w1 0 ; for i := 1 step 1
a2: am. (b1.) ; until length do
bz w0 x1 0 ; begin
am. (f14.) ; databuffer(i +
hs w0 x1 +1 ; upperpointer) :=
al w1 x1 1 ; record(i)
se. w1 (b0.) ; end
jl. a2. ; databuffer(1+length+
rl. w0 b0. ; upperpointer) :=
am. (f14.) ; length
hs w0 x1 +1 ; end
a4: jl x3 +0 ; end
e.
\f
; fortran, pass 5, page 68
b. a4, b3 ; proc bufout(record;length)
; the next record is taken form the databuffer.
; the lowerpointer (pointing at the record of the buffer) is
; decreased by (1 + the recordlength).
; if the buffer is now empty, the lower - as well as the upper-
; pointer are reset, and the lwa is recalculated.
; if the buffer was empty, <length> is set to zero.
; the procedure is called from outconst in this way:
;
; al. w1 <start address>.
; jl. w3 d17.
; ; w0 = length
w. b1: 0 ; start address
b3: 0 ; return address
d17: rs. w1 b1. ; begin
rs. w3 b3. ;
al w0 0 ; length := 0
rl. w3 f15. ; if lowerpointer >
sh. w3 (f14.) ; upperpointer then
jl. a4. ; begin
bl w0 x3 0 ; length :=
ws w3 0 ; buffer(lowerpointer)
al w3 x3 -1 ; lowerpointer :=
rs. w3 f15. ; lowerpointer
al w1 0 ; - length - 1
a2: am. (f15.) ; for i := 1 step 1
bz w3 x1 +1 ; until length do
am. (b1.) ; record(i) :=
hs w3 x1 +0 ; buffer(i +
al w1 x1 1 ; lowerpointer)
se w1 (0) ;
jl. a2. ; if lowerpointer =
rl. w3 f14. ; upperpointer then
se. w3 (f15.) ;
jl. a4. ; lowerpointer :=
rl. w3 2 + f15. ; upperpointer :=
rs. w3 f11. ; lwa :=
rs. w3 f14. ; lwa-databuffer
rs. w3 f15. ; end
a4: jl. (b3.) ; end
e.
\f
; fortran, pass 5, page 69
b. ; proc error(no,param)
; trouble is set to true, and troublerecord no. <no> ,parameter
; <param> is output. return is made to the head program.
; it is called from action 35, 36, and 37 in this way:
;
; al w0 <no>
; rl. w1 <param>.
; jl. d18.
w.
d18: hs. w0 1 + f34. ; begin
hs. w1 2 + f34. ;
al w0 1 ; trouble := true
rs. w0 f38. ; outrec(4,
al w0 4 ; <troublerec. no. <no>>)
al. w1 f34. ;
jl. w3 d5. ; goto read next record
jl. d1. ; end
e.
b. a16, b12 ; proc outconst
; (wanted; delivered)
; this procedure tries to output one constant or one constant-
; group, but not more than the wanted number of constants.
; the constants are taken from the databuffer.
; delivered is set to the number of constants delivered.
; this number may be equal to zero if the buffer is empty.
; if a repetitionfactor is equal to one, neither this nor the
; datastar are output.
; the procedure is called from action 35 and 36 in this way:
;
; al w0 <wanted> ;
; jl. w3 d19. ;
; ; w0 = <delivered>
w. b0: 0 ; wanted
b1: 0 ; w1 - store
b2: 0 ; w2 - store
b3: 0 ; return address
h. b4: 0 ; dyamin
b5: 0, r. 9 ; record 1
b6: 0 ; datastar
b7: 0, r. 9 ; record 2
w. b8: 0 ; delivered
b9: 0 ; length 1
b10: 0 ; length 2
h. b11: 0, r. 3 ; record 3
w. b12: 0 ; length 3
\f
; fortran, pass 5, page 70
d19: ds. w1 b1. ; begin
ds. w3 b3. ;
al w0 0 ; dyamin := 0
hs. w0 b4. ;
al. w1 b5. ; bufout(record1;length1)
jl. w3 d17. ;
rs. w0 b9. ; if length1 = 0 then
se w0 0 ; begin
jl. a6. ; delivered := 0
rs. w0 b8. ; goto a16
jl. a16. ; end
a6: al. w1 b5. ;
jl. w3 d5. ; outrec(length1,record1)
a8: al w0 0 ; datastar
hs. w0 b6. ; := 0
al. w1 b6. ; bufout(datastar;
jl. w3 d17. ; length2)
rs. w0 b10. ;
bl. w0 b6. ; if datastar =
bl. w1 29 + f42. ; <dyamin> then
se w0 x1 +0 ; begin
jl. a9. ; dyamin := <dyamin>
hs. w0 b4. ; outrec(1,
al w0 1 ; <dyamin>)
al. w1 b4. ; bufout(record3,
jl. w3 d5. ; length3)
al. w1 b11. ;
jl. w3 d17. ; outrec(length3,
rs. w0 b12. ; record3)
al. w1 b11. ; goto a8
jl. w3 d5. ; end
jl. a8. ; if datastar <>
a9: bl. w1 b6. ; <datastar> then
bl. w2 9 + f44. ;
sn w1 x2 +0 ; begin
jl. a10. ; bufback(datastar,
rl. w0 b10. ; length2)
al. w1 b6. ;
jl. w3 d14. ; delivered := 1
al w0 1 ; goto a16
rs. w0 b8. ;
jl. a16. ; end
a10: al. w1 b7. ; bufout(record2;
jl. w3 d17. ; length2)
rs. w0 b10. ;
rl. w0 1 + b7. ; if record2 >
ws. w0 b0. ; wanted then
sh w0 0 ; begin
jl. a15. ; record2 :=
rs. w0 1 + b7. ; record2 - wanted
rl. w0 f14. ; if databuffer
sn. w0 (f15.) ; not empty then
\f
; fortran, pass 5, page 71
jl. a12. ; begin
al w0 3 ; bufback(record2, 3)
al. w1 b7. ;
jl. w3 d14. ;
al w0 1 ; bufback(datastar, 1)
al. w1 b6. ;
jl. w3 d14. ;
bl. w0 b4. ;
sn w0 0 ; if dyamin <> 0 then
jl. a11. ; begin
rl. w0 b12. ; bufback(record3,
al. w1 b11. ; length3)
jl. w3 d14. ;
al w0 1 ;
al. w1 b4. ; bufback(dyamin, 1)
jl. w3 d14. ; end
a11: rl. w0 b9. ; bufback(record1,
al. w1 b5. ; length1)
jl. w3 d14. ; end
jl. a14. ; else
a12: rl. w0 b9. ; begin
al. w1 b5. ;
jl. w3 d16. ; bufin(record1,
bl. w0 b4. ; length1)
sn w0 0 ;
jl. a13. ; if dyamin <> 0 then
al w0 1 ; begin
al. w1 b4. ; bufin(dyamin, 1)
jl. w3 d16. ;
rl. w0 b12. ; bufin(record3,
al. w1 b11. ; length3)
jl. w3 d16. ; end
a13: al w0 1 ; bufin(datastar, 1)
al. w1 b6. ;
jl. w3 d16. ;
al w0 3 ; bufin(record2, 3)
al. w1 b7. ;
jl. w3 d16. ; end
a14: rl. w0 b0. ; record2 := wanted
rs. w0 1 + b7. ; end
a15: rl. w0 1 + b7. ;
rs. w0 b8. ; delivered := record2
sh w0 1 ;
jl. a16. ; if record2 = 1
al w0 1 ; then goto a16
al. w1 b6. ;
jl. w3 d5. ; outrec(1, <datastar>)
al w0 3 ;
al. w1 b7. ; outrec(record2,3)
jl. w3 d5. ;
a16: rl. w0 b8. ;
dl. w2 b2. ;
jl. (b3.) ; end
e.
\f
; fortran, pass 5, page 72
b. a16, b7 ; proc commonsearch
; (ident. no.;
; array,no,length,start)
; a search for the ident. no. is performed through the list
; containing descriptions of the commonvariables in data
; statements.
; if the ident. no. is not found, a <trouble integer description>
; and a <trouble> - record no. e86+2 are formed.
; contrary array is set to true, if it is an identifier of an
; array, no. is set to the number of elements (no. = 1 for a
; simple variable), and the length and the startaddress of the
; description are found.
; this procedure is called from action 35 in this way:
;
; input output
;
; w0: ident.no. array
; w1: irrelevant no
; w2: irrelevant length
; w3: return addr. startaddr.
w. b0: 0 ; ident. no.
b3: 0 ; return address
b4: 0 ; array
b5: 0 ; no
b6: 0 ; length
b7: 0 ; startaddress
\f
; fortran, pass 5, page 73
d20: rs. w0 b0. ; begin
rs. w3 b3. ; pointer := fba-com.var.
rl. w2 f22. ; for i := 1 step 1
a4: sl. w2 (f23.) ; while pointer <
jl. a12. ; lba-com.var. do
rs. w2 b7. ; begin
al w0 0 ; start := pointer
rs. w0 b4. ; array := false
bz w0 x2 +0 ; find(rec(pointer);
jl. w3 d12. ; length, dummy)
rs. w0 b6. ; length if not array
se w0 0 ; if length = 0 then
jl. a6. ; begin
al w0 1 ; array := true
rs. w0 b4. ; pointer :=
al w2 x2 1 ; pointer + 1
bl w1 x2 0 ; length :=
al w0 x1 2 ; 2 + record(pointer)
rs. w0 b6. ; end
ba. w0 +1
a6: wa w2 0 ; pointer:=
bl w0 x2 0 ; pointer + length
se. w0 (b0.) ; if record(pointer) =
jl. a10. ; ident. no. then
al w0 1 ; begin
se. w0 (b4.) ; no:=if not array
jl. +8
bl w0 x2-1 ; change to two
ls w0 12 ; bytes for no of elements
hl w0 x2-2 ; in array in data statements
rs. w0 b5. ; else rec(point.-1)
jl. a14. ; goto a14
a10: al w2 x2 +1 ; end
jl. a4. ; pointer := pointer + 1
a12: bl. w1 29 + f49. ; end
al w1 x1 +2 ; comment: not found
hs. w1 4 + f34. ;
al w0 2 + e86 ;
hs. w0 1 + f34. ;
rl. w0 f54. ;
hs. w0 2 + f34. ;
al w0 0 ; array := false
al w1 1 ; no := 1
al w2 5 ; length := 4 + 1
al. w3 f34. ; start := trouble
jl. a16. ;
a14: dl. w1 b5. ;
dl. w3 b7. ;
a16: jl. (b3.) ; end
e.
w. i25: 0 ; first free word
i21 = k - i20
e30 = e30 + i21 ; length := length + length pass 5;
i.
e. ; end pass 5
m. rc 83.08.29 fortran, pass 5
▶EOF◀