N.B. In section 3.4.(ii), PROCS has been replaced by PROCR. This is believed to be a typing error in the printed manual.

N.B. In section 5.4.1 Type 3, second paragraph, consists had been replaced by constant. This is believed to be a typing error in the printed manual.

N.B. In section A.3.4 under entry for actions 133-134, action number in table has 133 replaced by 134. This is believed to be a typing error in the printed manual.

N.B. In section A.4 1st Reference (iv), greater has been replaced by greater or equal. This is believed to be an original error in the printed manual.

        PART 2: INTERCODE TRANSLATION

                                    CONTENTS

        1.   INTRODUCTION
         1.1 Tasks
         1.2 Data
         1.3 Results
         1.4 Organisation

        2.   PASS 0
         2.1 Tasks 
         2.2 Data
         2.3 Results
         2.4 Procedure

        3.   PASS 1
         3.1 Tasks 
         3.2 Data 
         3.3 Results
         3.4 Procedure

        4.   PASS 2
         4.1 Tasks 
         4.2 Data
         4.3 Results
         4.4 Procedure

        5.  PASS 3
         5.1 Tasks 
         5.2 Data
         5.3 Results 
         5.4 Procedure

        6.  END ROUTINES



8/0                                                             Amendment No.32
                                                                July 1966


Section 1 1. INTRODUCTION The Intercode translator converts programs written in Intercode into the form required for allocation. The translation process is carried out in six passes which will be detailed in the sections following:- 1.1 Tasks of the Intercode Translator The tasks of the Intercode Translator are:- (i) To produce on magnetic tape the Computer Code version of the program in a form suitable for allocation. (ii) To maintain an Intercode version of the program on magnetic tape for use in subsequent amendments. (iii) To provide facilities for amendment of programs written in Inter- code. (iv) To produce printed copies of the program in Intercode and/or machine code as required. 1.2 Data The data for the Intercode Translator consists of the Intercode program on paper tape (or cards), or, if this is amending run, the program on magnetic tape and amendments on paper tape (or cards). 1.2.1 Form of an Intercode Program An Intercode program as presented to the Translator consists of the following:- Program Heading Parameters to identify the program and list its files and other general information. Section Description to specify input/output sections and working areas. Procedures containing the Intercode instructions of the program. Tables to govern the format of data and results Constants required by the program TRAMD, Trial Data and Post-Mortem point sheets if required Program END sheet. The Intercode specification (part 1 of this volume) describes in detail the form in which programs and program amendments are submitted to the Translator. 8/0 Amendment No. 32 July 1966
Section 1.3 1.3 Results The Translator produces:- (i) A magnetic tape containing the Intercode and computer code versions of the program. (ii) If required, a magnetic tape holding the computer code program only. (iii) A printout of the complete program, or of those parts of it affected by the current amendment, and, if required a print out of the computer code program. 1.4 Organisation (i) To perform the above tasks, the translator is divided into 4 main passes, numbered 0-3. The remaining passes maintain and amend trial data and postmortem points if any, and write the Program Trials System routines onto the program tape if required. (ii) There are three possible types of Translation. An initial trans- lation, recognised by the initial directive PROGM, an amending run, recognised by the initial directive AMEND, and a trials routine amendment, preceded by the directive TRAMD. This directive can also be submitted in the course of either of the first two types of run. (iii) Several programs may be translated in succession without reallocating the translator. Any combination of the above runs are acceptable. 2. PASS 0 2.1 Tasks (i) To read and check the paper tape (or card) input file, checking, in the case of an AMEND run that the correct magnetic tape has been submitted and that the paper tape (or card) amendments correct- ly apply to it. (ii) To copy the input paper tape or card onto the working tape, with an indicator of error if any. (iii) To compile lists and indices for the use of other passes, notably:- a) A table of OLD against NEW procedure numbers. 8/0 Amendment No. 32 July 1966
b) A table of the adjust details necessitated by this amendment. c) A table of 'unique references' to inserted instructions against the line serial which will apply to the instructions. d) A procedure type index. (iv) In the case of a TRAMD run, Pass 0 copies the entire Intercode and computer code program onto the output file, and then calls in pass 4 to amend or set up trial data and post mortem points. In this case function (iii) above is not required. 2.2 Data The data for Pass 0 are the Intercode program on paper tape (or card), or, for an AMEND or TRAMD run, the Intercode program on magnetic tape and amend- ments on paper tape (or card). 2.3 Results (i) A verified copy of the input paper tape (or card) file on a work- ing tape. (ii) Carried forward details left in the store (see (iii) above). (iii) In the case of a TRAMD run a copy of the input program tape ready for trial data amendment. 2.4 Procedure The input magnetic tape file (if any) is opened and the required program, as specified in the AMEND or TRAMD block located. The procedure type index which was written onto the tape when the program was last translated is read into store. Amendments are read from paper tape (or card) checked for legality, and written onto the working tape. For each insertion or deletion an entry is made in a table of adjust details, and for each unique reference an entry is made in a list, associating the reference with the line serial which it will be given in Pass 1, calculated from the table of adjust details. No adjust details are stored when an entire procedure is inserted or deleted, but an adjustment is made to the OLD/NEW procedure numbers index, and the appropriate insertion or deletion made in the procedure type index. In the case of an initial translation the OLD/NEW procedure numbers index and a procedure type index only are formed, there being no adjustments or unique references. When the Inter- code END sign is encountered on the paper tape (or card) input, the file is closed and the working tape rewound. Pass 1 is then entered. 8/0 Amendment No. 32 July 1966
Section 3 3. PASS 1 3.1 Tasks The Tasks of Pass 1 are:- (i) To produce an updated version of the Intercode program on magnetic tape, incorporating any amendments. (ii) To allocate serial numbers to each line of the program. (iii) To carry out range checks on the data. (iv) To set up carry forward details for Pass 2. 3.1.1 Serial Numbers A 5-digit serial number is made up of the 3 more significant digits, specifying a procedure or section number, and the 2 less significant digits, specifying an item within that procedure or section. Serial numbers are allocated by Pass 1 to every item within a program, except the file and section details, and the post-mortem point and trial data information. Amendments are effected by reference to the serial numbers allocation in the previous amendment. The serial number is stepped by one for each item within a procedure or short constants section, and by two for each item within a table or long constants section. The program END sign has a line serial to enable insertions to be made before it. 3.2 Data The data for Pass 1 consist of the input Intercode program (if any) and the amendment file on the working tape. 3.3 Results In the case of either an initial or an amendment run, the results are:- (i) An updated Intercode program, bearing error reports for illegal data, on magnetic tape. (ii) Carry forward details in the store for Pass 2. 3.3.1 Carried forward details left in the store The details left in store for use of pass 2 are as follows:- 8/0 Amendment No. 32 July 1966
Section 3.3.1 (Cont'd) (a) A list of chapter end points, incorporating the "corrected" chapter number for the chapter, and an indicator to show whether this chapter overlays another, is overlaid by another, or is the only chapter to be read into this position. The details for each chapter are held as a short word in the following form:- Q1 Corrected chapter no. (= uncorrected number if Q2=0) __ Q2 15 if chapter is overlaid or overlays 0 otherwise Q3-5 The last procedure number of the chapter in binary, unless this is the last chapter, in which case Q3-5 hold 151515 (b) Switches, unpack/condense (item+) counters and indirect modific- ation registers, in three separate lists, with counters showing the position (within one of the Translators extra procedures in the chapter) of each facility used in this chapter. The details are held in a short word in the following form:- (i) Switches. B1-10 procedure no. (in binary) B11-16 position of switch within Translators 'Switch procedure' B17-20 Corrected chapter no. (ii) Item + counters. Q1-2 section no. (in binary) used in the 51/53 action which sets the counter Q3-4 position of item + counter within Translators 'switch procedure' Q5 Corrected chapter no. (iii) Indirect modification registers. Q1-2 Modification register no. in binary Q3-4 Position of modification register with Trans- lators 'switch procedure' Q5 Corrected chapter no. (c) Details of all sequence changes back are stored by Pass 1 for Pass 2. 8/0 Amendment No. 32 July 1966
Section 3.3.1 (Cont'd) For this purpose, sequence change actions are:- 70-79, 94, 97, 124/1/0, 127/d/m and continuation lines of 85, 87 and 150 actions. A list is maintained in destination order, containing the updated serial numbers of source and destination. (d) Lists of files, transit areas, old/new indices used in each distinct convert action and Intercode lines bearing TRACE as the first five characters of the annotation are also carried forward. 3.4 Procedure If the translator is called in by the CLEO compiler, Pass 1 is the first pass to be called, all necessary lists are left in store by the compiler and an indicator set so that the program is translated with no amendments being applied. Pass 1 first determines whether it is dealing with an initial or an amendment run. On amendment runs, blocks are read from the amendment file and the input program tape. By reference to the serial number of the next amendment, it is decided which block to process. Once this decision has been taken, the method of dealing with the block is basically the same as for an initial translation. (i) Program heading and section information. The details required for the above lists are stored, the data checked for self- compatibility, and output. (ii) Directive. The presence of one of the directives PROCR CONST or TABLE signifies the end of the section details, and also a change of data type during later processing. The procedure number is checked to ensure it lies within the range 100-998 and has not been submitted before. (iii) Instructions, table entries, constants. These are checked for legality and compatibility, and output. When Pass 1 recognises the program END sign it enters its end routine. 3.4.1 Amendments Amendments are effected whenever the amendment and main input line serials match. Out of sequence amendments are ignored. Amendments to trial data and post mortem points are not processed until Pass 5. 8/0 Amendment No. 32 July 1966
Section 3.4.2 3.4.2 File Layout The output Intercode, from the first PROCR, TABLE or CONST directive onwards, is written in multi-record format in blocks of up to 75 words. 4. PASS 2 4.1 Tasks (i) To translate each Intercode action into its computer code equivalent, retaining the sectional addressing. (ii) To print the Intercode program, or such parts of it as have been amended, as required. (iii) To form up carry forward details for Pass 3. 4.2 Data The data for pass 2 are the updated Intercode program on magnetic tape, as written by pass 1, and the details left is store. 4.3 Results (i) An output computer code program on the working tape, bearing sectional addresses. (ii) A print out of the Intercode program, or of the amended parts. Each sequence change entry point has printed beside it the serial of the source. If there are several source addresses each is printed on a separate line, except the last, which is printed alongside the point which it addresses. To achieve this, the source and destination of all sequence changes forward are stored until the destination line has been printed. (iii) A list of procedure start addresses within chapter for use by pass 3 in completing the addressing. (iv) A list of TRACE points and their addresses within chapter. 4.4 Procedure The heading blocks and file details are first printed, then the CHAPS block. Following this is an INDEX line which summarises the layout of chapters with reference to the programmers overlay actions. This information is not held on the program tape, but is recalculated at each amendment. Following the sections, the Intercode instructions, 8/0 Amendment No. 32 July 1966
Section 4.4 (Cont'd) table entries and constants are printed. Any error reports made by Pass 1 are printed alongside the appropriate line, and, provided pass 1 has not indicated that the line must be ignored, it is then expanded into the appropriate computer code actions, table entry or constant and these written onto the magnetic tape. A space counter is updated by the appropriate number of locations for each line. This counter is stored at each PROCR, TABLE or CONST directive in the procedure start 1ist for Pass 3 and also at each TRACE point, and is reset to zero at each chapter start. At the end of each chapter, the translators constants and working location are output, and at the end of all the initial chapters an extra chapter is output. 4.4.1 Parameters Each computer code instruction, table entry or constant has associated with it a parameter which is referred to by the program loading sequence to determine its absolute address when loaded. This governs reference to other chapters, to files and transit areas and modification registers. The parameters are calculated by Pass 2 and output together with the instruction. For further details see Appendix B. 4.4.2 Directive blocks These are the data types PROCR, TABLE, CONST, VALUE and END. A switch is set up when such a block is encountered which governs the processing of all records until the next such block is found. A TYPE unit is generated on the working file to indicate the change of data type to pass 3. The current value of the space counter is also output, together with the procedure number. If the section number corresponds to a chapter start, the chapter end routine is first entered. 4.4.3 Chapter Start At the start of each chapter, a 'Procedure 0' is generated. This contains locations for each parameter, each bearing that parameter, and a subroutine for entry to the program trials system from a post- mortem point (see Vol IV). 4.4.4 Instructions Each Intercode instruction is translated according to its group (i.e. the top one or two digits of the action number) and its variant (the least significant digit). In general each path from the group switch passes to a variant switch, thus determining the processing of the action and its c-lines, if any. If the translator finds that it may not be able to store sufficient formed constants to translate the next action, all formed constants 8/0 Amendment No. 32 July 1966
Section 4.4 (Cont'd) are dumped into the program, preceded by a sequence change to the next action. A line CONST is printed in the program at this point, and a special TYPE unit is output, to indicate to Pass 3 that the constants are translator constants. The computer code expansions of Intercode actions are given in appendix A of part 1 of this volume. 4.4.5 Table entries Each Intercode table entry is converted to one computer code table entry occupying 2 short compartments. 4.4.6 Constants Constants are translated according to the directive which precedes them. All constants are right aligned. 4.4.7 Chapter End When a new chapter start, or a TRAMD or END directive is encountered, the chapter end routine is entered. (i) Translator constants are output to magnetic tape. (ii) The chapter length is calculated and stored. 4.4.8 Value directive This directive is acceptable only on the brought forward program tape. It is generated by the Cleo Compiler, and may not be submitted or amended from paper tape (or card). No calculations are performed on the data, which is written out unchanged for Pass 3. 4.4.9 Extra Chapter The extra chapter generated at the end of the initial chapters contains:- (i) 200 words for Master Routine tables, containing information about allocated annexe and routes. (ii) Convert tables. These are held in the special chapter in order that they may be readily available for all chapters wishing to use them. (iii) Sections and annexes specified, in the section description, to be placed in the special chapter. The special chapter has a minimum length of 512 locations. 8/0 Amendment No. 32 July 1966
Section 4.4.10 (Cont'd) 4.4.10 Error Reports If, for instance, a switch is addressed in the program, without it having been defined (by an 85 action), an error report is given by pass 2 on a separate line, following the offending reference. This is because the line is printed before it is trans1ated. 5. PASS 3 5.1 Tasks (i) To insert addresses relative to chapter start in all instructions, table entries and constants. (ii) To output the translated program to magnetic tape, preceded by the Program loading Sequence. (iii) To print out a summary of the procedure start addresses etc. or to print the entire computer code program as required. 5.2 Data The data for pass 3 are the magnetic tape working file containing the expanded program as output by pass 2, and results left in store. 5.3 Results (i) Computer code program, following the updated Intercode on the output file. (ii) Printout as required. 5.4 Procedure The programmer's section lengths are augmented to the chapter in which they occur, and the chapter length increased accordingly. The length of each of the initial chapters is calculated as the maximum of the lengths of the chapters overlaying or overlaid by it. Lines are printed giving these chapter lengths, and details of files and transit areas. The program loading sequence is written at the start of the program tape, this is held in store, and comprises five chapters:- (1) Unloader (2) Allocate Store. This is followed by a block containing the allocation details of chapters (3) Allocate Routes and Transit areas. This is followed by blocks containing the details of required transit areas. (4) Allocate F.P. Modification Group, Tag, Switch (5) Load Program 8/0 Amendment No. 32 July 1966
Section 5.4 (Cont'd) The computer code program is then written onto the tape with corrected addresses calculated from the list of procedure starts left in store by pass 2. 5.4.1 Main Loop The working file is read in 4-word units, of which the TYPE unit is used to set a switch for all data until the next TYPE unit. At each TYPE unit, a heading is printed giving the procedure/section number (if full computer code printout is being produced), or else the procedure number is printed with its start address, 12 per line, for the summary printout. Certain special procedures are taken for each type, as follows:- TYPE 1 : INSTRUCTIONS 0' Intercode line serial number 2' Contains 0,1 or indicator in Q3 4' Bits 1 to 7 = parameter, bit 8 = negative item, indicator Q3 to Q5 = reference 6' Bits 14 to 21 = action/discriminant/modifier, bits 1 to 13 = modulus of item If word 2' contains 0, this is a normal instruction; word 4' is decoded to extract the reference, and hence the procedure start address, to which the item is added/subtracted, as bit 8 of word 4 = 0/1 respectively. The address is then packed with A/d/m in word 6' and the result output with the parameter from word 4'. If word 2' contains 1, then this instruction is a forward sequence change. If it is the nth such instruction, its address is selected from the nth position in a list built up during Pass 2 (see Appendix J), packed with A/d/m from word 6' and output with the parameter from word 4'. If word 2' contains a number different from 0 or 1, it represents a special parameter; this is output together with the contents of word 6'. The parameter consists of a number in the Q3 position, with values indicating a special address to be formed by the Master. (1) 'Input/Output' entry to Master (2) 'Offer options' entry to Master (3) 'End programme' entry to Master 8/0 Amendment No. 32 July 1966
Section 5.4.1 (Cont'd) (4) 'Overlay' entry to Master (5) 'Comment in log' entry to Master (7) PTS entry to Master (15) 'Adjust chapter stacker' - causes the stacking modification register to be augmented by the amount given in the associated word, before loading the next word (see TYPE 7 below). TYPE 2 : Table Entries 0' Bits 1 to 7 = parameter, bit 8 = '-0' indicator, Q3 to Q5 = reference 2' First item (bits 1 to 13), sterling indicator in bit 17 4' Second item for unpack/condense tables, or Q5 ≠ 0 if item is zero 6' Q6 to Q10 of machine code table entry (control constants) For tables type 1,3 (edit/unpack fixed) word 4' will be zero. It is possible that the last table entry indicator has been submitted with zero control constants, such that word 6' consists only of the LTE indicator, i.e. the number '-0'; this is indicated by bit 8 = 1, in word 0'. Word 0' is decoded to recover the parameter, reference, which together with word 2' make the first word output. The second word generated consists of word 6' + zero parameter, unless word 6 consists of '-0' in which case the special parameter of 15000 is generated with a zero word. For tables type 2,4 (condense/unpack variable) word 4 represents the item from the 'last reference/item' entry. This is used with the reference in word 0. Should this second item be zero, Pass 2 will have set Q5 of the word non-zero. The first word is generated as in the preceding paragraph; for the second word, the second address must be added/subtracted from word 6' and set with the 'last table entry' indicator as discovered from the '-0' indicator or sign of word 6'. The second word is given the parameter from word 0'. TYPE 3 : Programmer's Constants 0' Bits 1 to 7 = parameter, bit 8 = '-0' indicator, Q3 to Q5 = reference 2' Least significant half of long word 4' Bits 1 to 7 = parameter, bit 8 = '-0' indicator, Q3 to Q5 = reference 6' Most significant half of long word 8/0 Amendment No. 32 July 1966
Section 5.4.1 (Cont'd) This represents one long constant or two short constants, where the reference/parameter is only non-zero if the constant is relative address. Bit 8 of word 0' will always be zero, but for a long constant the top half would be '-0' (e.g. the number -473 held long) in which case bit 8 of word 4' = 1. The start address for the reference is added to the item in word 2', 6' and output with the given parameter. The special parameter 15000 is generated for the constant '-0'. TYPE 4 : Table Start Points These correspond to the 15-bit constants needed for convert table starts and during the table lookup actions, and are identical in form and processing to TYPE 3. TYPE 5 : Translator's Formed Long/Short Constants 0' Least significant half first word 2' Most significant half first word 4' Least significant half second word 6' Most significant half scored word This represents two long constants or four short constants, which are output with zero parameter. TYPE 6 : Discontinuity Indicator This TYPE is used when formed constants have been dumped in the middle of a procedure, or at the end of TYPE 7 (see below). Apart from the modified heading which is printed when the TYPE unit is processed, it is identical to TYPE 1; It is used so as to avoid printing a PROCEDURE heading (it prints CTD), TYPE 7 : Values There are two forms of unit: (i) 0' ' ' 2' ' ' 4' Reference 6' Item (ii) 0' 0 2' 0 4' Parameter 6' Address 8/0 Amendment No. 32 July 1966
Section 5.4.1 (Cont'd) The first form is generated by Pass 2 when dealing with a new reference / item; Pass 3 uses it to deduce an adjustment to the chapter stacker; the TYPE 7 block contains the current space counter, i.e. the address into which the next word would go. The difference between the reference/item and this address is generated as a 'word' and given parameter of 1500 in Q3. An adjusted space counter is set up, to which is added 1 for each subsequent parameter value processed until the next unit (i); this is then subtracted from the new reference/item to make another stacker adjustment. __ TYPE 14 : Chapter End Sign. __ This generates a zero word with parameter 150000. The Pass 3 output block is terminated here and a heading block is written for the next chapter (which begins at the start of the subsequent block). __ TYPE 15 : Program End Sign The final lines are printed, the output tape is run back to the start of the computer code program, the working file is rewound and the terminal alarm is given. 6. END ROUTINES Three chapters of the Translator comprise the end routines. The first, usually called 'Pass 4' stores details of procedure and section starts, and TRACE points, for future TRAMD runs of the Translator; and writes the first section of PTS onto the program, if it is required. The next chapter, pass 5, is identical in form and function to the Trials Program 08005 (see Vol. 5 section 12). If there are no post-mortem points or trial data, or when the END sign is encountered on the amendment file, pass 6 is called in, if PTS is required to write the remaining routines on the program tape. Then the tape is run back to the start of the machine code, the final lines are printed giving a summary of the errors and the 'MADE BY' line. INTERCODE TRIAL DATA SERIAL NUMBERS OF INTERCODE REPORTS PT, OMITTED YES/NO YES/NO DISASTROUS X X XXXXX ..... OTHERS X X XXXXX ..... MADE BY 08000 ISSUE X SERIAL XXXXX ON XX/XX/XX SPOOL XXXXX Under the heading 'Serial Numbers of Intercode Reports' are listed the first ten reports which have been made against lines having serial numbers. Errors concerning file description and multiple destination of sequence changes do not have such reports. The end alarm is then offered. 8/8 Amendment No. 40 June 1967
APPENDICES A. THE CHECKING ROUTINES OF PASS 1 B. THE PARAMETER SYSTEM C. THE PUNCHED CARD INPUT TRANSLATOR D. SIMPLIFIED OPERATING INSTRUCTIONS E. MAGNETIC TAPE LAYOUTS F. PRINT LAYOUTS G. FLOWCHARTS H. OVERLAY I. THE SWITCH/ITEM +/INDIRECT MODIFICATION REGISTER FACILITIES J. SEQUENCE CHANGE Amendment No. 15
Appendix A APPENDIX A : THE CHECKING ROUTINES OF PASS 1 AND PASS 2 Range and consistency checks are made by Pass 1 on all parts of the Intercode Programme. If any check fails an indication is written in the 'error' word on the Intercode file, and if a consistency check fails the last 5 characters of annotation are replaced with '?????'; these report words are cleared when the b/fwd. file is read at the next amendment. The indication will be printed out with the programme in Pass 2, which may also add its own error reports; the reports made by Pass 2 are further consistency checks which can only be discovered to fail when the entire Intercode file has been analysed by Pass 1. Under certain circumstances, the Translator will report what could be errors, but in fact are non-standard uses of facilities. It is possible to suppress the report on a line by setting the first five characters of annotation at /////, which will clear any report not containing 4 or 5 question marks (the indication of serious error). A.1 Heading Information Type of Error Indication PROGM block (i) suite ≠ 3 digits * P1 (ii) job ≠ 2 digits * P2 (iii) programme identity zero * P3 ENTRY block (i) first word not ENTRY * E1 (ii) procedure number outside range * E2 100 toe 998 (iii) Priority class outside range * E3 1 to 4 (iv) Entry procedure not present in ????R program File details (i) File identity not 1 alpha and 1 * F1 numeric character (ii) Route type outside range 1 to 9 * F2 (iii) Alternate route indicator not * F3 0 or 1 and route type not, 19 (iv) Route type not 5,7,9 yet ????? * F4 alternate route indicator = 1 (file not stored for later checks) (v) More than 8 files specified (the * P5 extra files are not stored for later checks) (vi) No entry in 'max. block size' * F6 8/0 Amendment No.32 July 1966
Appendix A.2 A.2 Section Description Sheet Type of Error Indication CHAPS block (i) number of chapters is outside range 1-14 (a safety value 1 is set internally) * C1 (ii) a chapter start point is outside the range 100 – 998 * C2 (iii)number of chapters > number of start points. * C3 Section details (i) section number is out- side range 1-99 ????? * S1 (ii) section length is outside range 0-4096 ????? * S2 (iii)transit area indicator is not 0 or 1 ????? * S3 (iv) chapter number negative, or > number of chapters in CHAPS block ????? * S4 (v) more than 8 transit areas, note that the 'transit area indicator' is used to step the counter ????? * S5 (vi) section number has already been used. ????? * S6 8/9 Amendment No 3/41 March 1968
Appendix A.3 A.3 Instructions Instructions are checked according to entries in a constants section held in Pass 1. Each entry comprises one short word as follows: Q1 bits 1 - 3 'Disc/mod' switch setting bit 4 Indicator A Q2 bits 1 - 3 'Ref/Item' switch setting bit 4 Indicator B Q3 'literal' switch setting Q4,5 Binary action number (zero for C-lines) Entries are held in ascending action number order, and consecutive actions checked in the same manner are held as one entry under the largest action number. Q1-3 are zero if the action does not exist in Intercode. A table look-up selects the appropriate checking entry for a new action, while the C-line of an action is checked by the entry immed- iately following that for the main line of the action. 8/9 Amendment No 3/41 March 1968.
Appendix A.3 (Cont'd) Indicators A, B are used to ensure that a C-line follows or does not follow the current action according to the values: A = 0 C-line impossible A = 1 C-line essential B = 0 C-line impossible B = 1 C-line possible, not essential These indicators are set in a separate routine when checking a 43, 54, 55, 77 or 78 action, as they depend on data other than the action number. The checks made according to the settings of the 'Disc/mod', 'Ref/item', 'Literal' switches are given below. Certain checks are applied independently of the switch setting, i.e. Check Error Indication (i) Item < 8192 I (ii) If D ≠ 0, I is even I (iii) D in range 0 - 2 D (iv) M in range 0 - 20 ????? M (v) Action exists (Q1 - 3 ≠ 0) ????? A (vi) Indicator A = 1, yet this is ????? not a C-line Ignore previous instruction (line) (vii) This is a C-line, yet A = B = 0 ????? A (viii) Item within procedure > 99 ????? A.3.1 Details of 'Disc/Mod' Switch - M Switch Settings Check Error Report 1 No further check 2 (i) D = 0 D (ii) M = 0 M 3 D = 0 D 4 M = 0 M 5 (i) D = 0 D (ii) M ≠ 0 ????? M 6 M ≠ 0 ????? M 7 (i) D = 0 D (ii) M = 0 M (iii) if L = 0, R ≠ 0 L if L ≠ 0, R = 0 Amendment No, 19 4/0 October 1963
Appendix A.3.2 A.3.2 Details of 'Ref/Item' Switch - R Switch Setting Check Error Report 1 (i) if R = 0 I ≥ 0 ????? I (ii) R < 1000 ????? R (iii) if R < 100, section number exists ????? R 2 (i) R = 0 R (ii) I = 0 I 3 (main line of a file control action) (i) file R exists ????? R (ii) if route type 1-4, 9, action is 40, 41 or 43 ????? RA (iii) if route type 5, 6 action is 40, 41 or 42 ????? RA (iv) if route type 7, 8 (MT) and action is 41 or 48, L is in range 0-3 L 4 (i) R < 1000 ????? R (ii) R in range 100-998 R (iii) I is even I 5 (i) R is a section (i.e. switch = 1) (as switch = 1) (ii) R is a transit area ????? R + 'ignore previous instruction' 6 (i) R < 1000 ????? R (ii) R in range 100-998 R Issue 3 Amendment No. 17 Translator June 1963
Appendix A.3.3 A.3.3 Details of 'Literal' Switch - L Switch Setting Check Error Report 1 None 2 |L| not greater than 10 quartets L 3 L positive or zero ????? L 4 L less than 20 L 5 digits of L are 0 or 1 L 6 L in range 1-15 L 7 L less than 8192 ????? L 8 L not greater than 5 quartets L 9 L less than 4096 L 10 L non-zero L 11 L zero L 12 L less than 100 L 13 (i) if L = 0, set indicator A (ii) if L ≠ 0, not greater than 5 quartets L Issue 3 Amendment No. 17 Translator June 1963
Appendix A.3.4 A.3.4 Table Entries used in Checking Instructions Action Action No. Table Entry Q5-4 Q3 Q2 Q1 00-06 6 11 1 1 07-08 8 11 1 9 C-line 0 11 1 1 09 9 11 1 1 10 10 2 2 2 11-12 12 3 2 2 13-15 (non-existent) 15 0 0 0 16-17 17 10 1 1 18 (non-existent) 18 0 0 0 19 19 10 9 1 20-29 29 11 1 1 30-33 33 4 2 2 34 34 11 1 1 35 35 5 2 2 36-37 37 11 1 1 38 38 6 2 2 39 39 11 2 2 40-41 41 5 11 2 C-line (optional) 0 5 11 2 42,43 43 11 3 9 first C-line 0 11 13 1 second C-line (43 only) 0 11 4 1 44 44 5 11 1 C-line (optional) 0 5 11 1 45 45 5 3 1 46-49 49 5 3 9 C-line 0 1 1 7 50-53 53 11 1 11 C-line 0 11 4 2 54 54 9 9 3 C-line (optional) 0 11 1 3 55 55 7 1 9 Issue 3 Amendment No. 17 Translator June 1963
Appendix A.3.4 (Cont'd) Action Action No. Table Entry first C-line 0 11 1 9 second C-line (optional) 0 11 1 1 Note: if L ≠ 0, the first C-line is checked with entry 0/11/1/1 56 56 11 1 1 57 57 1 1 7 58 58 1 1 2 59 59 1 1 13 C-line 0 11 1 4 60-61 61 11 2 1 62 62 8 2 2 63-64 64 11 1 1 65 65 8 1 9 C-line 0 8 2 2 66-69 69 11 2 2 70-76 76 11 6 2 77-78 78 13 14 2 C-line (optional) 0 11 1 2 79 79 11 6 2 80-82 82 1 6 2 83 83 12 6 2 84 84 11 14 2 C-line (optional) 0 11 1 1 85 85 11 6 10 C-lines 0 11 14 1 86 86 1 6 2 87 87 11 1 11 C-lines 0 11 14 1 88-89 (non-existent) 89 0 0 0 90 90 7 2 13 C-line 0 7 2 2 91-93 93 11 1 6 94 94 9 1 5 95-96 96 11 2 5 97 97 11 9 5 Issue 3 Amendment No. 17 Translator June 1963
Appendix A.3.4 (Cont'd) Action Action No. Table Entry C-line (optional) 0 11 6 2 98-99 99 11 2 6 100-131 (machine code) 131 11 9 1 C-line (action 123/0/0) 0 11 1 1 132 132 11 3 2 133-134 134 5 3 10 135-139 (non-existent) 139 0 0 0 140-149 149 11 9 1 C-lines 0 11 1 1 150 150 12 1 15 C-lines 0 11 14 1 151 151 11 2 2 152 152 11 4 10 C-line 0 11 4 2 153 153 11 2 2 154 154 11 1 2 155 155 11 2 2 156 156 11 3 1 157 157 11 1 11 C-line 0 11 4 3 158 158 5 1 1 A.4 Table Entries Below is a list of the errors which may be found on checking entries and the indication used for each. Error Indication 1st Reference (i) Reference < 100 and section no. } not submitted on section } description. } } (ii) Reference < 100 and section no. } T1 submitted as transit area. } } (iii) Reference zero. } (iv) Reference ≥ 100 and no such section no. exists. R 1st Item Item > 9999 8/0 Amendment No. 32 July 1966
Appendix A.4 (Cont'd) Error Indication 2nd Reference (i) Reference < 100 and section no. } not submitted on section } description sheet } } (ii) Reference < 100 and section no. } T3 submitted as a transit area } } (iii) Reference non-zero for unpack } fixed or edit table } (iv) Reference ≥ 100 and no such section no. exists R 2nd Item (i) Item > 9999 } } (ii) Item non-zero for unpack fixed } T4 or edit table } Short/Long/Alpha not in range 0 - 2 T5 Single/to block (i) not in range 0 - 1 } end } (ii) non-zero in unpack fixed or } T6 edit table } Number and (i) 'no.' + 'disc' > 5 or 10 depending } Discarded on entry in short/long/alpha } column } } T7 (ii) 'no.' non-zero for unpack } variable or condense table } (iii) 'disc' non-zero for unpack T8 variable or condense table Spaces (i) 'spaces' > 15 } } T9 (ii) 'spaces' non-zero for unpack } variable or condense table } Issue 3 Amendment No. 17 Translator June 1963
Appendix A.4 (Cont'd) Zeros (i) 'Zeros' > no. of chars depending on entry} in short/long/alpha column } } T10 (ii) 'Zeros' non-zero for unpack variable or } condense table } Sign (i) Not in range 0 to 2 } } T11 (ii) Sign is type 1 in unpack variable or } condense table } Sterling (i) Indicator not 0 or 1 } } (ii) Indicator non-zero for unpack variable } or condense tables } T12 } (iii) Indicators with value 1 not occurring in } groups of 3 consecutive entries } Last Table Entry (i) Last table entry not 0 or 1 } __ } T13 (ii) Entry in 'single/to BE' column but not } in last table entry } For tables type 1 (edit), a check is made on the number of characters edited between consecutive 'last table entry' indicators; if this is not a multiple of 5, the report SUM is made against the last table entry. 8/0 Amendment No. 32 July 1966
Appendix A.5 A.5 Constants Range checks are carried out on each character, and on the entire constant if it is not mixed. Consistency checks are carried out on the use of the directive characters '(' and ',' and also the number of times that they occur are cross-checked. Report if range check fails * Report if consistency check fails ????? (ignore translation) A.5.1 Range Checks on Characters Alpha - no check Decimal - control = 0,1,3,4 basic no check Binary - control = 0,1,3,4 basic = 0 - 9 Pattern - control = 0,1,3,4 basic = 0,1 __ Relative address - control = 0,1,3,4 basic = 0 - 9 or 13 A.5.2 Range Checks on Constants Short Alpha not more than 2 chars. Long Alpha 5 chars. Short Decimal 5 + sign Long Decimal 10 + sign Short Pattern 20 + sign Long Pattern 40 + sign Short Binary bits 1-20 + sign (1048575) Long Binary 10 quartets + sign Realative Address if R < 100, section exists and is not a transit area. Amendment No. 19 4/0 October 1963
Appendix A.5.3 A.5.3 Consistency Checks If a check fails, all constants are ignored up to the next beginning with an acceptable directive. The constant is translated as a zero long/short compartment, as given by the constants section type, if it is ignored. The checks effected are: (i) Total space occupied by constant in the transit area (i.e. including amendment directive and constant directive) not more than 45 characters. (ii) First constant in a section begins with '('. (iii) '(' is followed by A, B, D, P or R, followed in turn by ')'. Where the directive is B, up to 2 decimal digits may precede ')'. (iv) Not more than 5 directives (or 4 commas) in the constant. (v) A constant containing '(' may not contain ',' and vice versa. The number of commas must be equal to (directives in main line of mixed constant) - 1. A.6 Trial Data and Post-Mortem Points - See Volume 5 Section 12. A.7 Checks on Amendment Directive A.7.1 The Amendment directive letter must be R, A, D or T. The previous switch setting is used if this fails, the initial value being an 'escape' which will generate the report '□□□□□', against the first N lines of the programme, where the unknown amendment occupies N blocks. A.7.2 Modifications must be submitted in order. The sequence check is made at every directive with an acceptable letter, and on the second line of a 'delete from ..... to .....' amendment. The report consists of the amendment directive which is out of order, and '??', e.g. 14703A ?? The modifications are read and ignored up to the next acceptable amendment directive or end sign, whichever occurs first. 8/0 Amendment No. 32 July 1966
Appendix A.7.3 A.7.3 The checks on amendments to a directive block PROCR/TABLE/ CONST are designed to avoid errors occurring by having two procedures with the same number, or accidentally deleting a procedure number. (i) A directive block cannot be replaced by a non-directive block. (ii) A non-directive block cannot be replaced by a directive block. (iii) When a directive block is replaced, the procedure number must be identical with the previous contents (exception: previous contents zero). The new directive must be of the same type as the original one, i.e. a procedure or short constants section must not be changed into a table or long constants section. (iv) An inserted directive block must have a non-zero procedure number, which is different from any procedure number brought forward (even though it may be deleted during this run) or inserted in the current amendment. Also the insertion can only be made before the start of another procedure, or a DUMPS/FILES/END directive. The report is in the same form as in A.7.2 but for an insertion which is rejected, the serial number printed will be that before which the insertion is being made. The modifications are read and ignored up to the next acceptable directive. A.7.4 If any coding is found on the line of a T-directive a report in the same form as A.7.2 is made. The coding on this line is ignored and the remainder of the modifications are inserted. A.8 Further Error Reports Note that most of the following imply limitations on the Translator's internal storage capacities. Indication Error ????R Either more than 50 unique references have been used, and this line contains an unstored unique reference, or this 3 digit reference no longer exists in the program (e.g. the addressed procedure has been deleted). 8/9 Amendment No. 3/41 March 1968.
Appendix A.8 (Cont'd) Indication Error ????S Either more than 48 distinct 85 actions exist, or this is an 83/84/86 action acting on an unidentified switch. ????M Either the modification digits are not in the range 4-20, or this is an action using a MR not referred to in any 90/91/92/93 action in the program. ????+ Either there are more than ten 51/53 actions acting on distinct sections or the section is not referred to by any 51/53 action in the program. 8/9 Amendment No 3/41 March 1968.
Appendix A.8 (Cont'd) ????C There are more than 25 distinct convert tables in the program. ????Y There are more than 100 active sequence changes forward at this moment. ????Z The expanding sequence change forward list has caught up with the contracting sequence change back list. (Note: The S.C. back list contracts 2 words when the source of a S.C. back is translated, the S.C. forward list expands 1 word when the destination of a S.C. forward is translated. S.C.'s forward to the start of a procedure do not get stored in the list. The storage space for S.C.'s is such that the most favourable case is 1000 back + 4000 forward and the least favourable is F forward + B back where 4B + F = 4000; Pass 2 can over-write the contracting S.C. back list by the expanding S.C. forward list). ????* The address of this instruction has been deleted during this amendment run. ????? The item of a 3-digit reference is greater than 99 or less than 2. The only place where an item greater than 99 does not cause cumulative mistranslations at each subsequent amendment is in the 'last items' of a condense table entry. In this case however, no adjustment of the item can take place if there are insertions or deletions which affect the line serial of the addressed quantity. Note: A 3-digit reference number with an item greater than 99 or less than 2 is undefined. 8/6 Amendment No. 38 March 1967
Appendix B THE PARAMETER SYSTEM B.1 Parameters When any information is presented to the Master Programme to be loaded, a parameter is associated with each half word of information Which indicates what adjusting constant should be added to the half word of information on loading. Parameters are calculated in Pass 2. The value of any parameter is as follows: Notes Parameter Parameter Value -----------------+---------------+--------------------------------------- | 0 | 0 -----------------+---------------+--------------------------------------- | 1 | 15-bit start address of chapter 1 | | Programme | 2 | 13-bit start address of chapter 1 | . | . | . | . | . | . | . | . Has | 2C-1 | 15-bit start address of chapter C | | C chapters | 2C | 13-bit start address of chapter C -----------------+---------------+--------------------------------------- | 2C+1 | Route number of 1st file Programme | . | . Has | . | . R routes | . | . | . | . | 2C+R | Route number of Rth file -----------------+---------------+--------------------------------------- | 2C+R+1 | P1 (Pseudo route number allocated | | to 1st transit area) | | Programme | 2C+R+2 | - (64 + P1) Has | . | . S transit | . | . areas | . | . | . | . | 2C+R+2S-1 | PS (Pseudo route number allocatad | | to Sth transit area) | | | 2C+R+2S | - (64 + PS) -----------------+---------------+--------------------------------------- | 2C+R+2S+1 | 8m' (m' in allocated mod. group) | | | 2C+R+2S+2 | - (8m' + 2) | | | 2C+R+2S+3 | - (8m' + 4) | | | 2C+R+2S+4 | - (8m' + 6) -----------------+---------------+---------------------------------------
Appendix B.2 B.2 Modification end Parameter Subroutines Each instruction for which the parameter is not automatically apparent to the translator, passes through the modification and parameter subroutine. The tasks of this subroutine are: (i) To set up in a specified location the parameter for the computer code version of the instruction being translated. (ii) To insert any extra instructions which may be necessary to deal with transit areas, other chapters, and modifications. Normally each computer code instruction in a translation will have parameter 2c (where c is the current chapter number) if its address refers to a compartment, or parameter 0 if its address is a literal, (except in the case of Intercode actions 100 - 131 which are dealt with specially as described below). Modification of non-modifiable instructions (intercode mod. type 2), or by M.R. > 3, involves the insertion of extra instructions. References to transit areas or other chapters involve a change to the parameter, and the insertion of extra instructions. These cases are dealt with below. Note, however, that a programme in the 090 suite (Master Programme) is specially treated - see paragraph (1) below. The notation used is as follows. C = number of chapters in programme R = number of routes used by programme S = number of transit areas in programme c = current chapter number c' = chapter number of reference (if different from c) c'' = chapter in which M.R. > 3 is located (if different from c) s = transit area number of transit area being dealt with (numbered 1,2,3, etc. in order of submission on section description sheet).
Appendix B.2 (Cont'd) The expansion of 'add (MR)' takes one of three forms: Action Address Parameter (a) MR 1 to 3 24/0/3 0 2c 4/0/0 2m 2C+R+2S+1 (b) MR 4 to 20 in current chapter 4/0/0 (address of MR) 2c (c) MR 4 to 20 in other chapter 24/0/3 2c'' - 1 2c 4/0/0 (address of MR) 0 The simple expansions, the 'select base address' of the complex expansions and the criteria for deciding whether the expansion is simple or complex are described below under each category of reference. B.2.2 Expansions B.2.2.1 Item + Conditions for complex expansion are any one of the following combinations: (i) Action modified by MR 4 to 20, item positive or negative; or (ii) Modified by MR 1 to 3, but the modifying digits of the action in machine code indicate a microplane variant, not a modification register (e.g. 0/d/2 28/d/2); item positive or negative; or (iii) negative item. All other combinations cause the simple expansion. Simple Expansion Action Address Parameter (a) Item + counter in this chapter 24/0/3 (address of ctr) 2c A/d/m I 0 (b) Counter in another chapter 24/0/3 2c'' - 1 2c 24/0/3 (address of ctr) 0 A/d/m I 0 Complex Expansion (Select Base Address) (a) Item + counter in this chapter 6/0/0 (address of ctr) 2c (b) Counter in other chapter 24/0/3 2c'' - 1 2c 6/0/0 (address of ctr) 0 B.2.2.2 Reference 1001 to 1020 The conditions for simple/complex expansion are the same as for 'item +'. Amendment No. 24 5/1 May 1964
Appendix B.2 (Cont'd) Simple Expansion Action Address Parameter (a) SR link (word N) in 24/0/3 N 2c this chapter 24/1/2 R-1000 0 A/d/m I 0 (b) SR link in other chapter 24/0/3 2c'' - 1 2c 24/0/3 N 0 24/1/2 R-1000 0 A/d/m I 0 Complex Expansion (Select Base Address) (a) SR link in this chapter 24/0/3 N 2c 24/1/2 R-1000 0 24/0/2 I 0 (b) SR link in other chapter 24/0/3 2c'' - 1 2c 24/0/3 N 0 24/1/2 R-1000 0 24/0/2 0 0 B.2.2.3 Absolute Address The condition for complex expansion is that the action has a negative item (which is only legitimate when the action is modified). Simple Expansion Action Address Parameter (a) Unmodified or MR 1 to 3 where 24/0/3 0 2c mod digits in action indicate A/d/m I 0 a register (b) Modified by MR 1 to 3 where 24/1/2 2C+R+2S+M+1 2c mod digits in action indicate A/d/m I 0 a variant (c) Modified by MR 4 to 20 in 24/0/3 (address of MR) 2c this chapter A/d/m I 0 (d) Modified by MR 4 to 20 in 24/0/3 2c'' - 1 2c other chapter 24/0/3 (address of MR) 0 A/d/m I 0 Complex Expansion (Select Base Address) In this case the base address is the contents of the indicated modification register. The expansion therefore generates no orders here, but arranges to select (6/0/0) rather than add (4/0/0) the contents of the indicated modification register, in para. B.2.1. Amendment No. 24 5/1 May 1964
Appendix B.2 (Cont'd) B.2.2.4 Reference = Transit Area The conditions for simple/complex expansion are the same as for 'item +'. Simple Expansion Action Address Parameter 24/1/2 2C+R+2s 2c A/d/m I 0 Complex Expansion 24/1/2 2C+R+2s 2c 24/0/2 0 0 B.2.2.5 Reference = Current Chapter The expansion is always of the simple type: Action Address Parameter (a) Unmodified, or MR 1 to 3 A/d/m R,I 2c where the mod digits of the action indicate a register (b) Modified by MR 1 to 3 where 24/0/0 2C+R+2S+M+1 2c the mod digits of the action A/d/m R,I 2c indicate a variant (c) Modified by MR 4 to 20 in 24/0/1 (address of MR) 2c this chapter A/d/m R,I 2c (d) Modified by MR 4 to 20 in 24/0/3 2c'' - 1 2c other chapter 24/0/1 (address of MR) 0 A/d/m R,I 2c B.2.2.6 Reference = Other Chapter The conditions for simple/complex expansion are the same as for 'item +'. Simple Expansion Action Address Parameter 24/0/3 2c'' - 1 2c A/d/m R,I 0 Complex Expansion (Select Base Address) 6/0/0 2c'' - 1 2c Amendment No. 24 5/1 May 1964
Appendix B.3 B.3 Intercode Actions 100 to 131 These actions are not translated by the 'modification and parameter' SR, and the programmer is required to insert the (computer code) instructions necessary for inter-chapter references, etc. If the address is in the current chapter, the instruction has parameter 2c. If not, the parameter is zero unless the programme is in the 090 suite (Master Programme), when the parameter is 2c'', where c'' is the addressed chapter. Actions 24/1/0, 27/d/m are treated as Intercode 70 to 76; i.e. the entry points are printed and the address calculated by storing the space counter at an entry point. The action following action 23/0/0 is translated as a 15-bit address (i.e. address of indirect modification register). 5/1 Amendment No.24 May 1964
Appendix C APPENDIX C : THE PUNCHED CARD INPUT TRANSLATOR. Punching Specifications Item Column (i) Sentinel Card Five sentinel marks 1 - 5 Translator suite number 6 - 8 Translator job number 9 - 10 'B1101' 'B1301 11 - 15 or etc. (ii) Progrm. Block 'PROGM' 1 - 5 Suite number 6 - 8 Job number 9 - 10 Annotation 36 - 75 Card serial number (if any) 76 - 80 (iii) Amend Block 'AMEND' 1 - 5 Suite number 6 - 8 Job number 9 - 10 Issue number (right aligned) 11 - 13 Serial 14 - 15 Print Pass 3 (0/1) 16 New issue number if required 17 - 19 Trial indicator 20 Annotation 36 - 75 Card serial (if any) 76 - 80 (iv) Entry Block 'ENTRY' 1 - 5 Procedure number of entry point 6 - 8 Priority class (right aligned) 9 - 10 Coder 11 - 15 Checker 16 - 20 Annotation 36 - 75 Card serial (if present) 76 - 80 Amendment No.28 7/0 November 1964
Appendix C (Cont'd) Item Column (v) File Description Serial number 1 - 2 File identity 3 - 4 Route type 5 - 6 Chapter 7 - 8 Maximum block size 9 - 12 Alternate route indicator 13 - 16 Annotation 35 - 75 Card Serial 76 - 80 (vi) Chaps Block 'CHAPS' 1 - 5 Number of chapters 6 - 7 Chapter start point 1 8 - 10 Chapter start point 2 11 - 13 Chapter start point 3 14 - 16 . . . . Chapter start point 14 47 - 49 Card serial number 76 - 80 (vii) Section Description Serial number 1 - 6 Section number 7 - 8 Size 9 - 12 Transit area indicator 13 Chapter number 14 - 15 Annotation 36 - 75 Card serial number 76 - 80 (iii) Procr Block PROCR 11 - 15 Number 16 - 18 Annotation 36 - 75 Card serial number 76 - 80 Amendment No.28 7/0 November 1964
Appendix C (Cont'd) Item Column (ix) Notes of Procr NOTES 11 - 15 RADIX - if required 36 - 40 Radix letter if required 42 Annotation 43 - 75 or Annotation 36 - 75 Card serial number 76 - 80 (x) Sheet Block 'SHEET' 1 - 5 Sheet number (right aligned) 6 - 10 (xi) Table/Const 'TABLE/CONST' 11 - 15 Number 16 - 18 Type 19 Annotation 36 - 75 Card serial number 76 - 80 (xii) Notes of Table 'NOTES' 11 - 15 Annotation 36 - 75 Card serial number 76 - 80 (xiii) Instructions Serial Number 1 - 2 Action 7 - 9 Reference 10 - 12 Item (±) 13 - 17 D 18 M 19 - 20 Literal (±) 21 - 30 Annotation 36 - 75 Card serial number 76 - 80 Note: __ __ (a) References 1001 to 1020 are to be punched as 1001 to 1020. (b) Literals which include quartet values of 10, 11, 12, 13, 14 or 15 are to have these numbers punched as 8+2, 8+3, 8+4, 8+5, 8+6 and 8+7 respectively, i.e. non-standard double punching. Amendment No. 22 5/0 February 1964.
Appendix C (Cont'd) Item Column (xiv) Table Entries Serial number 1 - 2 First reference 7 - 9 First item (±) 10 - 14 Second reference 15 - 17 Second item (±) 18 - 22 Short/long/alpha 23 Single/to block end 24 Number of characters 25 - 26 Discards 27 - 28 Spaces 29 - 30 Zeros 31 - 32 Sign 33 £ 34 L.T.E. 35 Annotation 36 - 75 Card serial number 76 - 80 (xv) Constants Serial number 1 - 2 Constant (left aligned) 7 - 35 Annotation 36 - 75 Card serial number 76 - 80 Note: (a) The constant is punched right aligned in a left aligned field; for alpha characters, a short constant of X is punched sp X, and a long constant of Y is punched sp sp sp sp Y. (b) Where constants include characters 10, 11 these are to be punched as 8+2, 8+3, and not as 'tenpence', 'elevenpence'. A negative sign is the character 1/0 (i.e. 'tenpence'), and punched at the least significant end of the constant field. (xvi) End Block 'END' 1 - 3. Note: On amendment runs, Where a 5-digit serial number is required, space will be found for it in column number 1 - 5. Where an amendment directive letter is required, space will be found in column 6. Amendment No. 28 7/0 November 1964
Appendix D INTERCODE TRANSLATOR SIMPLIFIED OPERATING INSTRUCTIONS 1. Organisation of the Translator< 2. Sequence of events during a run 3. Facilities required by the Translator 4. Alarms and options Amendment No. 15 June 1963
Appendix D.1 Section 1. Organisation of the Translator The Translator converts programmes written in Intercode into the computer code form required by the Loader subroutines of the Master Programme. The process is carried out in four stages, referred to as Passes 0, 1, 2 and 3. It also forms the final stage in the process of converting CLEO via Intercode into computer code. 1.1 Functions of the Translator (i) To produce an output magnetic tape file containing the Intercode programme, then the Programme Loading Sequence, then the computer code programme. (ii) To display output either directly or by writing a magnetic tape file subsequently printed off by 08002. (iii) To print either the full Intercode programme or the changes introduced in the current run. (iv) To produce a full computer code printout, or a summary. (v) To allow for full file updating facilities so that any line of Intercode may be replaced, deleted or inserted during an amendment run. 1.2 Off-Line Printing of Translator Results The translator is always allocated printer file D1 when loaded, but if the initial contents of register A are specified as non-zero on the allocation data, the printer route will be released and an additional magnetic tape file A9 will be allocated, preferentially on Channel 0; failure to find a magnetic tape route results in alarm *10. Printing is done on-line if initia1 contents of A are zero. This file contains one block for every six lines normally printed by the Translator. It will be closed after *06 unless option 5 is taken to leave it open, i.e. one or more programs may be written on the tape. Off-line print tapes from Issue 3 Translator may only be printed off by Issue 4 or later of 08002. When the Translator is re-entered from alarm *06, the choice of printer/ magnetic tape for the output medium of the next amendment is determined by which option is taken at that alarm. 1.3 Data The Translator exists in both a paper tape input and card input versions, with either one paper tape block or one card for each line of the programme. For an initial translation the programme is submitted in the order it is to be translated; for an amendment run, the alterations are to be submitted in the same order as the points they amend on the input Intercode file. Amendment No. 32 8/0 July 1966
Appendix D.1 (Cont'd) 1.4 Results The Translator produces: (i) a magnetic tape containing the Intercode and computer code versions of the object programme and P.L.S; (ii) either a direct printout or a magnetic tape file for later printing, of the Intercode version and also the computer code version of the programme. 1.5 Organisation The first pass, Pass 0, arranges to replace the printer route by magnetic tape route or vice-versa if required. Pass 0 performs an initial analysis of the programme, or amendments if an amending run, to determine the final programme structure in the light of the paper tape/card data. Pass 1 updates the brought forward programme by the amendments, incorporating data calculated by Pass 0, or produces the initial programme tape. Pass 2 prints the Intercode programme, and partially translates the data into computer code instructions with Intercode addresses. Pass 3a generates the programme loading sequence and computer code heading data. Pass 3b completes the translation process. Pass 3c amends the PTS data (post- mortem points and trial data) and Pass 3d writes the PTS programme (if required). Amendment No. 26 7/0 November 1964
Appendix D.2 Section 2 : Sequence of Events During a Run 2.1 Initial Translation Pass 0 (i) If (A) are non-zero on the allocation data, D1 is released and A9 (magnetic tape) is allocated; if (A) are zero, A9 is released and D1 is allocated (unless the required medium is already allocated to the programme). Failure to find the required route is indicated by alarm *10. Success is indicated by the log comment: 08000 ALLOCATED EXTRA ROUTE xx (Channel, Route) A9 is allocated first on route type 7, i.e. Channel 0, then 8 or 11 if no suitable route can be found. (ii) B1, A6 are opened, and the first block of B1 is tested to be PROGM or AMEND. If it is neither, alarm *03 is given. If it is PROGM, this is an initial translation. (iii) B1 is read/copied to A6, while Pass 0 builds up indexes and lists. When the END sign is read on B1 it is closed, A6 is rewound and Pass 1 called into the store by overlay. Pass 1 (iv) A6, A2 are opened and A6 is read/copied to A2 with adjustments made from the details built up by Pass O. At the end sign on A6, both A6 and A2 are rewound and Pass 2 is called into the store. If the A6 file is incomplete (i.e. has END before CHAPS) alarm *01 is given. Pass 2 (v) A6, A2 are opened. For each block read on A2 a line is printed, and the partial translation written onto A6. At the end sign on A6, it is rewound (A2 being left in position) and Pass 3 called into the store. Pass 3 (vi) Pass 3 is a composite pass in four parts, each part overlays, but the tapes are not rewound between each pass. The sequence of events is as follows. Pass 3a opens file A6 and file A2 is realigned for output. The programme loading sequence is generated onto A2 followed by data for the Trials Programme (08005). A6 is then read to the FINIS block and run back. Pass 3b completes the translation to machine code from the intermediate translation held on A6. The machine code version is output to A2 following the data for 08005 and is also printed or output to magnetic tape file A9. Part 1 of the P.T.S. routine (the P.T.S. set-up routine) is generated and written onto A2 following the machine code copy of the programme. Amendment No. 28 7/0 November 1964
Appendix D.2 (Cont'd) Pass 3c writes the trial data onto A2 and prints (file D1) or writes onto A9 the summary of errors. Pass 3d generates part 2 (P.T.S. dumps routine) and part 3 (P.T.S. print routine) and writes these onto A2. During pass 3a the comment: 08000 PROG OUT (program) (serial) is typed out. (vii) At the end of Pass 3d alarm *06 is given. From here the operator can first make copies of the computer code program on A6 and then either unload the Translator or re-enter for another amendment/translation. 2.2 An Amending Run Pass 0 (i) If (A) are non-zero on the allocation data, D1 is released and A9 (magnetic tape) is allocated; if (A) are zero, A9 is released and D1 is allocated (unless the required medium is already allocated to the program). Failure to find the required route is indicated by alarm *10. Success is indicated by the log comment: 08000 ALLOCATED EXTRA ROUTE xx (Channel, Route) A9 is allocated first on route type 7, i.e. Channel 0, then 8 or 11 if no suitable route can be found. (ii) B1, A6, A1 are opened, and the start of the program to be amended is found by reading along A1. Alarm *02 indicates that the program is not present. The comment is typed: 08000 AMEND (program) (serial) If on a TRAMD run the following comment is typed: 08000 TRAMD (program) (serial) TO (serial) + P.T.S. (iii) B1 is copied to A6, as for an initial translation. At the END sign on B1, it is closed, A6 is rewound (A1 is left in position) and Pass 1 is called. 8/9 Amendment No. 3/41 March 1968.
Pass 1 (iv) A1 is read in parallel with A6, which updates it, and the result is written to A2. At the END sign on A1, A1 is closed, A2 and A6 are rewound and Pass 2 is called. Pass 2 and Pass 3 As for initial translation, except that according to indi- cators in the AMEND block, the printout from each pass will be either partial results or the complete program. Pass 3 ends at alarm *06 as before. 8/9 Amendment No. 3/41 March 1968.
Appendix D.3 Section 3 : Facilities Required by the Translator 3.1 Chapter Lengths Chapter 1 2574 locations approximately Chapter 2 7240 locations approximately Chapter 3 992 locations approximately 3.2 Files in Order of Allocation D1 Printer : Intercode and computer code programme B1 PT/Card input (alternate route) : Amending data A1 MT set to read, channel 0 : Brought forward programme A2 MT set to write, channel 1 (if available) : Carried forward programme A6 MT set to write, channel 0 : Working file (and subsidiary carried forward programme, if required) A1, A2 and A6 all have block lengths of 75 words. B1 has a block length of 27 words. 3.3 Other Facilities The Translator requires a modification group and 5 pseudo routes. 8/0 Amendment No. 32 July 1966
Appendix A4 Section 4 : Alarms and Options Alarm *01 Initial Translation - input programme has no chapter descrip- tion block CHAPS Option 1 End Translator Option 2 Re-enter Pass 0 Alarm *02 Programme to be amended cannot be found on file A1. Option 1 Unload Translator Option 2 Open new input file, continue search Option 3 Read Pass 0 into the store, re-enter (for a different amendment if required) (Note that A2 is not opened until the start of Pass 1). Alarm *03 First data block on file B1 is neither PROGM nor AMEND Option 1 End Translator Option 2 Re-enter Pass 0 Alarm *04 First block on file A2 is not PROGM Option 1 Read next block, repeat test Option 2 Rewind A2, read/enter Pass 0 Option 3 Unload Translator Alarm *05 This is a 'pause' alarm, for the operator to switch routes in preparation for joining the Translator onto the Compiler just produced. It only occurs at the end of Translating programme 08060, and the Translator programme tape is to be placed on the A1 route before continuing. Option 1 Read A1, A2 and copy to A6. (Note that A1, A2 and A6 are then closed and alarm *06 offered. Only options 1 or 2 are now allowed to this alarm *06). Option 2 Copy computer code version of the Compiler onto A6, return to *06. 8/0 Amendment No. 32 July 1966
Alarm *06 End of Pass 3 Appendix D.4 (Cont'd) Option 1 Close files, unload Translator Option 2 Close files, re-enter Pass 0 in order to print next amendment on-line Option 3 Copy computer code programme onto A6, close A6, return to *06 Option 4 Close files, re-enter Pass 0 in order to print next amendment off-line (i.e. via dump tape A9) Option 5 Re-enter Pass 0 to print next amendment off-line on same off-line print tape Alarm *07 End of Pass 3, output programme unacceptable Option 1 Close files, unload Translator Option 2 Close files, re-enter Pass 0 in order to print next amendment on-line Option 3 Copy computer code programme onto A6, close A6, return to *07 Option 4 Close files, re-enter Pass 0 in order to print next amendment off-line (i.e. via dump tape A9) Option 5 Re-enter Pass 0 to print next amendment off-line on same off-line print tape This alarm is given if either: (i) Pass 3 processes an instruction with a negative address, e.g. reference to a location earlier than the chapter start. It is not possible to report such errors earlier in the Translator; a list will have been printed at the end of the Pass 3 output, giving the procedure containing the wrong instruction, with the reference of that instruction's address, one report per line, where the offending instruction has been replaced by a 23/1/0 order so as to cause lockout if obeyed. or: (ii) The printing is being done off-line via the dump tape A9 and there is at least one 'disastrous' or 'PT omitted' report for the amendment. Alarm *08 Incorrect number of heading blocks on A6. Option 1 Go to alarm *06 Option 2 Read next block from A6, repeat test. 8/0 Amendment No. 32 July 1966
Appendix D.4 (Cont'd) Alarm *09 Input program not suitable for amendment Option 1 End Translator Option 2 Re-enter Pass 0 This alarm may occur for either of the following reasons: (1) Input program was last amended by a Translator earlier than Issue 6, and either: (i) has more than 500 procedures, or (ii) had more than 80 points of insertion/deletion at the previous amendment, or (iii) had more than 25 unique references at the previous amendment. The solution is to amend the program with Issue 6 Translator, then to amend it with Issue 7. (2) An attempt is being made to amend trial data only, but this program was last amended by a Translator earlier than Issue 7. Alarm *10 Required print medium not allocatable Option 1 End Translator Option 2 Attempt allocation again Option 3 Continue with present print medium. This arises when the print medium is to be different from that allocated, or used at the previous amendment (cf. *06 options) and no available route exists for the required medium. A route of the required type should be set available by command before taking Option 2. Alarm *11 No PROCR block on initial translation. Option 1 End Translator Option 2 Re-enter Pass O. This alarm may occur on an amendment run if the PROGM block is being amended and no AMEND block has been punched. 8/9 Amendment No. 3/41 March 1968.
Appendix E Magnetic Tape Layouts Intercode Programme File (Pass 1 O/P) Internal File (Pass 2 - Pass 3) Computer Code Programme File (Pass 3 0/P) Amendment No. 16 May 1963

Alarm *05 - This refers to 08060, the CLEO compiler. There were in fact, two versions of the compiler, 08060 and 08061. The latter was more efficient as it used more store and less overlays and was written for LEOs with larger store. - May be worth a comment.