This is a draft of Chapters 1-3 issued as Atlas Paper No 37. It was issued due to delays in the writing of Chapters 4-6.
The ensuing chapters describe how a program written as described in Part I is presented to and processed by the HARTRAN system. The processing in general consists of three main parts; compilation, loading and execution. If a program contains only BAS routines the compiling phase is omitted; alternatively a job may involve only compilation, no execution being expected, in which case the loading is omitted.
In the first phase, routines written in the source language FORTRAN are compiled and those written in ASP are assembled, i.e. routines written in either language are translated into the target language BAS (Binary and Arbitrary Symbolic). References entirely within the routine are dealt with by the translator; private names being converted into relocatable binary addresses, relative to the routine origin which is incorporated at load time, PUBLIC variables, PARAMETERS, routine names and common block names remain in symbolic form.
In this phase BAS routines, resulting from the compilation phase or any which have been previously compiled and appear in the card deck in BAS form, are loaded. Each is placed in the high-speed store of the machine in the position in which it is to be executed with the necessary adjustment of addresses (relocation); all remaining symbols are replaced by absolute addresses; and the values of PARAMETERS read from DEFINE cards and incorporated.
The third phase is the execution of the resulting program.
Large programs may be split up into independent sections called chapters each consisting of a number of routines. A job involving such a program is called a CHAIN job. This manual assumed that the majority of jobs will consist of a single chapter and the description is simplified accordingly, all information pertaining to CHAIN jobs being confined to Chapter 6.
A job is presented to the system as one or more documents. A document is a self-contained block of information presented to the computer through one input channel without a break. Each document is preceded by identifying information consisting of a heading followed by the document title. It is ended by a card punched with both 7 and 8 in column 1.
The majority of jobs involve only one input document and have other simplifying features. See 2.6 for a simplified description of such jobs.
Jobs originating at A.E.R.E. Harwell must have the job numbers constructed in the following way: the letter H followed by the four decimal digits of the charge number optionally followed by a fifth digit if the user requires further break-down of costing, etc.
The heading is one of the following
Alternatives which do not concern this manual are
COMPILER AUTOCODE COMPILER ALGOL COMPILER ABL etc
This consists of a list of all input and output documents of the job, and if explicit use is made of magnetic tapes that use is specified.
This section begins with the word INPUT followed by a list of all the other input documents required for the job, each preceded by its logical number (i.e. the number by which it is referred to in the program). The reference number of the program document is zero.
Example: A program with the title H095 YORK TEST OF ZZ99A may contain the statements READ c, list READ (l,d) list READ (2,d) list (see Part I, 7.1) The following job description cards would then be necessary INPUT 0 H095 YORK TEST OF ZZ99A 1 (Title of data document 1 2 (Title of data document 2
This section specifies the type of peripheral equipment to be used for each of the output streams. It begins with the word OUTPUT which is followed by a list of all the logical numbers of output documents (i.e. the numbers by which they are referred to in the program), each followed by the type of equipment to be used for its production. The equipment types are
LINE PRINTER CARDS TELETYPE ( 7 hole) FIVE-HOLE TELETYPE ANY (line printer if available, 7 hole paper tape if not)
Examples: OUTPUT 0 LINE PRINTER 15 CARDS 1 LINE PRINTER 2 CARDS
Note that (1) outputs 0 and 15 are used by the Atlas Supervisor program and by the compiler but are still available for output from the program (in fact they will be the most commonly used channels).
(2) More than one logical number may be associated with the same peripheral device even if only one such device exists. The outputs streams are accumulated separately in the machine and are output one after the other.
If a program uses magnetic tapes explicitly then each tape required is specified by two job description cards - a heading followed by a description.
The heading is either
The description card contains
(a) The logical number of the tape (i.e. the number by which it is referred to in the program).
Except for TAPE COMMON this is followed by
(b) The tape number (A.E.R.E, tape numbers will consist of *H followed by four decimal digits)
and (c) The tape title.
If a private tape requires to be protected, item (a) is preceded by *.
The maximum amount of output in each output stream may be specified and if not specified 10 blocks is assumed. When the output in any stream has reached the specified (or assumed) maximum execution of the job is terminated.
Examples 0 LINE PRINTER 16 BLOCKS 1 LINE PRINTER 400 LINES 16 CARDS 100 CARDS 2 CARDS 3 BLOCKS
A block is 512 words of 8 characters.
A line of print does not necessarily represent 132 characters nor a card 80. Each scores as many characters as specified by the relevant format statement, i.e. 20 X, 15, / is 26 characters. It appears that the average layout of printed matter contains about 40 characters per line and so a block is equivalent to about 3 pages. N.B. The output in streams 0 and 15 includes that from the supervisor and compiler.
The following job description card limits computing time
COMPUTING p.q HOURS COMPUTING p.q MINUTES COMPUTING p.q SECONDS
The job is stopped when this amount of computing time has been reached. In this context computing refers to the time during which the HARTRAN system rather than the Atlas Supervisor is in control and therefore includes compilation and loading as well as execution. Also time although specified in time units is in fact a measure of the number of instructions executed. Actual time may be specified and should be if significant tape waiting time is anticipated. For example:
EXECUTION 5 MINUTES COMPUTING 30 SECONDS
If a limit is not specified
COMPUTING 30 SECONDS
is assumed.
The card
STORE S
specifies that not more than S blocks of 512 are required by the program. If this card is omitted 20 blocks or 10240 words are allocated.
This consists of
Section (c) is made up of any mixture of the following in any order
The routines are loaded in the same order as they appear in the card deck. If this order is not important (see I, 2.3.4 and II 2.5.6) the loading process is most efficient if all the BAS routines are placed before all the FORTRAN and/or ASP routines.
HARTRAN directives may be inserted at the head of section (c), between any two routines (but not between two cards of the same routine) or at the end of the section.
A FORTRAN routine is punched on cards as follows:
HARTRAN directive cards are recognised by the presence of * in column 1. The type of directive is punched in columns 2-8, left-adjusted with no inserted blanks. Further information may be punched in columns 9-72; blanks are not significant, a free format is used, a number of items may be specified each terminated by a comma or column 72. Columns 73-80 are ignored by the loader and may be used for labelling, serial numbering, etc.
The first card of each BAS routine is a directive and identifies the routine as being a BAS routine. This card is produced by the compiler or assembler and hence is not normally punched by the programmer. It has a rigid format which is described in 3.3.
This card may precede any FORTRAN routine. It is essential before the first FORTRAN routine and also before any FORTRAN routine which is preceded by an ASP or BAS routine.
Columns 9-72 may optionally contain any selection of the following words in any order and separated by commas:-
CARDS, NO CARDS, LABEL, NO LABEL, LIST, NO LIST
CARDS is assumed unless NO CARDS appears
LABEL is assumed unless NO LABEL appears
NO LIST is assumed unless LIST appears
If no directive card is present before a routine then the same combination is taken as for the previous FORTRAN routine.
CARDS states that the BAS routine on cards is required.
LABEL causes a 6 characters label followed by a two-digit (decimal) serial number to be punched in columns 73-80 of the BAS cards, and the label to appear in the printed output from the compiler. The label is constructed by taking columns 2-7 of the first comments card in the routine, ignoring blanks and left adjusting the non-blank characters. If no comments Card is contained in the routine the name of the routine is taken for the label.
LIST causes the printed output from the compiler to include an ASP-like listing of the compiled routine and deletes execution.
May precede an ASP routine. A directive is essential before the first ASP routine of the program and before any ASP routine immediately preceded by a FORTRAN or BAS routine.
This marks the end of the program and that execution is required. If loading is successfully completed execution follows, any cards following the directive being treated as data.
This directive is placed before the first routine of a job which consists only of compilations and/or assemblies. It is then an error if the deck contains any BAS routines or any directives other than * FORTRAN or *ASP.
Any number of cards
*DEFINE d1, d2, d3, ..., dn
may be included in the deck.
d1, d2, d3, ..., dn are definitions of the form a1, a2, a3, .., am = b where a1, a2, a3, .., am are PARAMETERS not previously defined and b is an expression involving constants and/or previously defined symbols.
The expression is evaluated and the value assigned to the named PARAMETERS.
Any number of cards
*RENAME a1 = b1, a2 = b2, a3 = b3, ...an = bn
may "be placed in the deck.
a1, a2, a3 are routine names or PUBLIC variable identifiers in routines which follow this directive.
b1, b2, b3 are routine names or PUBLIC variable identifiers in routines which precede this directive.
It causes references to ai in the following routines and to bi in the preceding routines to be the same entity.
Interchange of two names (a and b) may be effected by
* RENAME c = a, a = b, b = c
A simple job, not using magnetic tape explicitly, having only one input stream, and using only PRINT and PUNCH statements for output may be presented as a single document made up as follows:-
(a) JOB (b) Title (see 2.1.2 and 2.1.3) OUTPUT 0 LINE PRINTER p LINES (where not more than p lines of output is expected 15 CARDS q CARDS (where not more than q cards are expected to be output) (c) COMPUTING r SECONDS (where the execution time is not expected to exceed r seconds) [N.B. the limits p, q and r include compiling and loading as well as execution] (d) COMPILER HARTRAN (e) The program (see 2.3, 2.4, 2.5) (f) The data (g) The document end card punched with both 7 and 8 in column 1.
During this phase all correctly written FORTRAN routines are compiled. If any is at fault and compilation cannot be completed this does not inhibit the processing of other routines. Nor does the presence of an error in a routine immediately stop the processing of that routine, further errors may be found but the compiler may be misled; it may miss real errors and invent others, there is no guarantee that the correction of those errors diagnosed will lead to a correct routine.
The BAS routine resulting from a compilation consists of:
The first card is punched as follows:-
Columns 1 - 4 *BAS 9 - 16 The name of the routine, left adjusted. 17 - 23 The entry point, relative to routine origin. 25 - 31 The length of the routine, i.e. the total number of words, program and private storage. 33 - 39 Number of auxiliary symbols defined [in an ASP routine, zero with a FORTRAN routine]. 41 - 47 Number of words of common storage used.
All numbers are in octal and right adjusted.
Example * BAS SIN 1 27 1 0
[The BAS routine SIN has entry at relative (relocatable) address 1, is of length 278 (=2310), uses one auxiliary symbol and no common store].
The remaining cards are all binary. They are all punched in rows 7 and 9 in column 1 and all but the last one also punched + in column 1. The format of binary information is not described in this manual.
Columns 73 - 80 constitutes the label field
The diagnostic prints given by the compiler are brief. They vary in form but all contain the word ERROR followed immediately by a number. It is frequently sufficient for it to be pointed out that a particular FORTRAN statement is in error, the error being obvious on examination. If the nature of the error is not obvious and for diagnostic not associated with a particular statement the tables given below should be consulted.
The errors diagnosed are of various types, characterised by the range of the key number, k. Not all key numbers are used, as the list was built up during development of the compiler, and some "errors" became obsolete.
These "errors" are mainly comments: anything looking a little strange is flagged just in case it is an error. If necessary an assumption is made about the intended meaning. In the compile and go system, execution will not be deleted for this class of error.
Example:
I = 9K POSSIBLE ERROR -1 (5) FOUND AT POSITION 10 OF THE ABOVE LINE
There are adjacent elements in the expression on the right-hand side, i.e. there is no operator between the 9 and the K. The error is detected when the K appears when an operator is expected: i.e. at position 10 of the line, assuming that I=9K occupies columns 7 to 10 of the card. The number in parentheses in this case is a function of what characters are legal at this point. The intended meaning is presumed to have been
I = 9*K
although the error could have arisen through some other mistake, e.g. a missing zone punch on the card, which should read I = IK.
These errors are of a more serious type and may subsequently cause execution to be deleted. A card is "window-punched" with the word FAILED.
Example:
ANGLE=SINF(((ALPHA+BETA)*GAMMA-THETA) GRAMMATICAL ERROR 8 (4) FOUND AT POSITION 72 OF THE ABOVE LINE.
There are too many left parentheses in the expression. The error is not detected until the whole of the card has been scanned, hence the pointer to position 72. For further processing, the statement is amended by adding a further ) at the end.
These are an indication that the compiler has been overtaxed in some way. A partial list is given. For remedial action and for those not listed consult a system specialist.
- 1 Adjacent elements in an expression - 3 Too few subscripts - 4 Constant too long - 6 Superfluous number in DIMENSION statement - 7 Incorrect or missing punctuation - 8 Inconsistent mode declarations - 9 Incorrect separator after an identifier - 12 Numerical element in logical segment - 14 Parameter previously defined as integer scalar - 15 FUNCTION or SUBROUTINE not first statement - 16 FUNCTION with no dummy arguments - 17 Statement obviously inaccessible (unnumbered) - 18 Statement at end of loop cannot legally be reached - 23 Multiplication by zero - 24 Only one successor in a computed GO TO - 25 Missing comma in assigned GO TO - 26 No successor after GO TO - 27 Incomplete ASSIGN statement - 28 TO omitted from ASSIGN statement - 29 Assigned GO TO with zero of blank successor - 30 Dimensions multiply defined, but consistent - 31 ATANF with two arguments - 31 MODF or AMODF with one argument - 33 MAXF etc., with one argument - 34 Exponentiation segment with more than two operands - 35 COMMON block length specified - 38 FORMAT statement number multiply defined - 39 FORMAT statement with no specification - 40 Insufficient successors after IF - 41 All successors after IF the same - 42 Logical or Text element in numerical segment - 44 Possible path of control to END statement - 45 FORMAT statement number is same as one on executable statement - 47 Text constant nil extends beyond end of statement - 48 Last statement of loop contains a jump to its immediate successor - 49 DO,FOR: integer occurs when index expected - 50 Extra argument given in library operation (e.g. REWIND 2,3) - 52 TRUNCATION: unrecognised or superfluous name - 53 TRUNCATION statement incomplete - 54 ASSIGN contains extra successor - 55 EQUIVALENCE: missing group parenthesis - 56 EQUIVALENCE: missing subscript - 57 Boolean constant too long - 58 Boolean field too big - 59 AFTER ERROR: extra routine name specified - 60 Identifier used both as label and calculation variable - 61 PUBLIC contains a dummy argument - 62 COMMON contains a dummy argument - 63 EQUIVALENCE contains a reference to a parametric array - 64 TRUNCATION statement recurs - 05 Subroutine name usea inside routine - 66 Function name was not used in routine - 67 No path of control to this basic block - 08 (Follows error 54 and gives positions of references) - 69 ASSIGN successor undefined - 70 Confused input/output statement - 71 Strange statement REAL) DRUM WRITE DRUM - 72 Hollerith constant or format spec, prematurely terminated - 73 Strange statement WRITE - 74 Input/output statement: unit or format identifier subscripted - 75 Format identifier is not a TEXT array - 76 Input/output statement: unit identifier is an array - 77 Jump statement mentions itself as a successor - 79 CALL subroutine name has been used otherwise - 81 FORMAT statement unnumbered - 82 Implied truncation - 83 Integer constant in an expression is out of range - 84 EQUIVALENCE: only one or no term in parenthesis - 85 Incompatible modes: LHS logical or text, RHS numerical - 86 Incompatible modes: LHS numerical, RHS logical or text - 87 Only two successors given for an arithmetic IF - 88 Name appears in COMMON or PUBLIC more than once - 89 Incompatible modes RHS complex, double length, text or logical - 90 Last statement in a loop is a jump
1 Too many subscripts 2 IF: parentheses do no match 3 Too many right parentheses in a statement 4 IF: to many successors 5 Adjacent operators in an expression 6 DIMENSION: array name already used as a function or declared parameter 7 Illegal character 8 Too many left parenthesis in a statement 9 DIMENSION: array name has numeric first character 10 DIMENSION: dimension real or missing 12 Illegal character in column 1 14 Identifier in an expression too long 15 Letter or punctuation in definition of statement number 16 Multiple definition of statement number on executable statements 18 Illegal nest structure for loops 24 Wrong number of arguments in call of a macro (open standard function) 27 Unrecognised .CODE. 28 Expression ends in wrong phase 29 No dot terminating .CODE. 30 Illegal combination of operators in one segment 31 DO or FOR: wrong number of control parameters 32 DO or FOR: control parameters not integer or real 33 Statement contains, at level zero after = at level zero, but is not a DO or FOR 35 Routine already named 36 SUBROUTINE, FUNCTION: dummy arguments duplicated in argument list 37 Parameter name previously defined 38 Expression on left-hand side of a calculation statement 41 Division by zero 42 ASSIGN: zero successor 43 Identifier in a declaration already used as a function 44 Dimensions multiply defined and inconsistent 45 COMMON: dimension not consistent 46 PUBLIC: variable dimension not declared parametric 47 COMMON, PUBLIC: identifier already used in other sense 48 IF: no successors or possibly parentheses not matching 49 EXTERNAL: identifier already used otherwise 50 Function or array name previously used as a scalar 52 Loops incomplete 54 Undefined successor 55 Undefined FORMAT 56 DO, FOR: loop ends on a transfer statement 57 Unmatched REPEAT 58 DO: FOR: index used in another current loop 59 IF: comma segment 60 Constant on left-hand side of a calculation statement 61 DO: FOR finishes a loop 62 DO: FOR: abatement number has already appeared 63 COMMON, PUBLIC, identifier is a function 64 Unrecognised statement 65 COMMON, PUBLIC, identifier is a parameter 66 EQUIVALENCE: variable in subscript 67 Statement number used was defined within a loop 68 Statement number defined has a jump to it from outside this loop 69 EQUIVALENCE: subscripted name not declared an array 70 EQUIVALENCE: identifier is a function 71 EQUIVALENCE: too many subscripts in subscripted variable 72 EQUIVALENCE: array has a variable dimension 73 EQUIVALENCE: inconsistent specification 74- EQUIVALENCE: two items in COMMON 75 DO, FOR: wrong separators 76 BLOCK name used as a variable 77 Dummy argument is a local function 78 Dummy argument is macro 79 Dummy argument is common block name 80 Dummy argument repeated 82 Local function contains a subscript 83 Local function used before definition or multiply defined 86 Routine name used as array, function or parameter 87 Input/output: index of loop is not a variable 88 Input/output: unit number not an integer scalar 89 EQUIVALENCE: variable not local, common, public or block 90 DO, FOR: index not a scalar variable 91 Input/output: left parenthesis probably introducing a subscript 92 CALL: routine name has been declared or used in another mode 93 Relation segment: explicit comma appears 94 Array name used as scalar variable 95 Function name used as scalar variable 96 Expression in an input list 97 GO TO: more than one successor 98 GO TO: illegal punctuation 99 GO TO: missing expression in computed GO TO 100 ASSIGN: illegal punctuation 101 EQUIVALENCE: illegal punctuation 102 Local function name previously used as a scalar, array, or local function 103 Local function: mixed complex, double length, logical or text in assignment 104 Local function dummy argument is not a scalar 105 CALL: illegal name on punctuation 106 Boolean constant contains the digit 8 or 9
1004 Expression too long 1005 Expression too long 1006 Expression too long 1007 Expression too long 1009 Expression too long 1011 Too many entries for list 1015 List of Hollerith text full 1016 Expression too long 1017 Expression too long 1017 Routine too long (≥32K) 1019 Input/output list too long 1020 Segment too long (≥100 operands) 1021 Input/output list too long