original
6 − 23 − 0 SECTION 6.4 USERCODE (DISC) COMPILER 64 A. IDENTIFICATION Computer: KDF9 Segment No: KAZ84 Title: PROMPT USERCODE COMPILER BRICK B. GENERAL DESCRIPTION Purpose: To compile USERCODE Source Programs held on a disc into machine code object programs stored on the disc. Input: A DISC containing a USERCODE Source Program written in the notation described in the KDF 9 Programming Manual, and preceded by the data shown in the Standard Heading Sheet. Output: 1. Messages on the MONITOR TYPEWRITER to indicate the progress of the Compiler. 2. A list of errors (failure reports) if any, located in the source program, output to the PRINTER. (The form and content of failure reports are specified in detail in DIVISION C). 3. Optionally, a table of the references in the source program and their corresponding machine addresses, to a PRINTER. An example of reference tables is included in Appendix 2 of Section 7.1. References from the PROMPI compiler are left hand zero suppressed. 4. A copy of the object program in BINARY FORMAT on the disc. Note: If any output occurs under heading 2, then output 4 will automatically be inhibited. C. METHOD OF USE Translation Directives. See Section 6.1 DIVISION C. Compilation Confirmation and Error Report Listings Introduction All TRANSLATE DIRECTIVES (see Section 6.1 Division C) successfully executed, give rise to confirmatory listings on a device selected from the lists specified within directives. KDF9
original
6 − 24 − 0 Section 6.4(cont.) 6.4 Furthermore, should errors arise, other than in the Directives themselves, Error Reports are also sent to the same device. The fact that either of these reports has arisen is noted on the MONITOR during processing (see Section 6.1 Division G). The format, content, and meaning, of the listings is specified below. Failure and Other Reports. Each message gives information about one error. The possible messages may be grouped under 5 headings. 1. Heading Sheet Errors Any error occurring up to and including the word PROGRAM (or PROG or PROGRAMME) is catastrophic to the compilation. It is not always possible for the compiler to give the exact fault, particularly if the items are incorrectly sequenced. The possible messages are: No P/T The first letter in the index block is neither P nor T. TITLE A non standard case normal character appears in the title. STLT } TLMT ) In its test for the specification V SEEC ) stated, the compiler either does W SPEC ) not recognise the set of letters, MTPR ) or does not accept the integer as START ) valid, or finds the specification YA SPEC ) incorrectly terminated. The first YI IN ) condition may hold if the correct YO IN ) sequence (as defined for Post in RESTRT ) ; Section 7.1 Appendix 4) is not PROG ) followed. The failure report PROGRAM can occur after several other failures. This can only occur when RESTART; has been used and when the word PROGRAM has been omitted. 2. Instruction Errors. When an instruction is invalid the message consists of two parts, a 'pointer' and a character string. The Pointer This is of the form Padddd Radddd.+ ddddd or Iddddd Rddddd + dddadd where Pddddd or Iddddd is the number of the current subroutine (PZZ¢~0 is the main program), Radddd is the last valid reference processed and +ddddd is the number of valid instructions
original
6 − 25 − 0 Section 6.4(cont) 6.4 processed since the last valid reference. The pointer and references are zero suppressed. The Character String This consists of the set of characters comprising the invalid instruction i.e. from the last valid instruction terminator up to and including the next terminator (3! or CR/LF in the case of all instructions and constant declarations except for a Vv=P constant in which case the only valid terminator is ';' or a comment in which case ');' is the terminator), and is terminated by an end message. In the case of a string consisting of more than 72 characters (most probable in the case of a Vv/v=P constant or in an unclosed comment) the first 64 characters and the last 8 characters make up the string. 3. Referencing Errors If a reference appears twice in the same subroutine or in the main program, the message is exactly as under heading 2. i.e. Pddddd Rddddd + ddddd dddd; where dddd is the reference and the pointer relates to the second occurrence of the reference. If a reference is omitted the message is of the form AT dddd@/s Pddddd Radddd NoT IN ddddd/s is the octal address/syllable number of the instruction in which reference Rddddd of subroutine Pddddd is included. When this type of failure message is produced then reference tables will be punched or printed, if these have been requested by the interrupt. Main program reference labels must be in the range 0−1011, This limit applies irrespective of module size. 4. Other Programming Errors Y0 SPEC OUT BY − dddd. Y0 has been incorrectly specified. dddd is the number of words by which the program and Wf overlap. Y > ST The store limit specified is smaller than either the declared specification or that derived from the programe EM FND An end message has been found in the program. This is normally caused by | an unclosed comment or by the word FINISH; being omitted. The failure report immediately previous to this message relates to the context in which the end message was found. KDF9
original
6 − 26 − 0 Section 6.4(cont.) 6.4 PROG 8192 WORDS The binary program exceeds 8192 words. S/R LONGER THAN dddd WORDS. This message is received when a single subroutine (including its V stores) exceeds the permitted length for the compiler. For details of length see heading 8. Z ST. This message is received when a store limit of zero is declared in the translate directives, and the program uses Z−stores. 5. Machine Fault Reports and Failures Due to Machine Size MACH dd dd is in the range 1−26. For details of dd see heading €. below. This report occurs in the case of a machine failure UPDATE A machine failure occurring in the updating process. FUNNY A machine failure occurring when an internal table cannot be interpreted. PARITY A parity failure has occurred. B/LIST This occurs when the YB specification of the Prompt compiler is too small. NO/SPC This occurs when the compiler used is too small to allow space for the program being compiled. If an overlength failure report is printed out, containing mainly referencing failures, often with Pd R¢ NOT IN, or otherwise with very large references, this is a machine failure of the type FUNNY. 6. Failures Output_on the Flexowriter by Translate Phase Control Following a Usercode Compilation. FAIL 00000 Normal program fault found during compilation. FAIL 00001 Machine failure. Incorrect sum check on a block being input. Failure message on output device MACHZ1 FAIL 00002 Machine failure. 0/P device message MACH2. Incorrect block count on a block being input. FAIL 00003 Machine failure on an input, or output, device.− 0/P device message MACHZ3 FAIL 00020 Machine failure equivalent to that resulting in a MACHINE failure report on the paper tape compiler. 0/P device message MACH24, FAIL 00021 This is the UPDATE failure described in (5) above. 0/P device message UPDATE. FAIL 00022 This is the FUNNY failure described in (5) above. 0/P device message FUNNY. KDF9
original
6 − 27 − 0 Section 6.4(cont.) 6.4 7. Warning Messages S/R LIST SHIFTED UP These are messages that do not interfere S/R LIST SHIFTED DOWN with the compilation but state that the compiler has been forced to move its sets of tables. 8. Size of Program Limitations The PROMPT USERCODE COMPILER uses a disc work area during compilation. The limitations as to the size of program which it can assemble depend upon the amount of information it has to keep in the store at any one time. The data space above the compiler is used as follows and in the given order. 1. Main Program reference tables. 2. Bit list for use in the updating process. 3. Main Program V−stores. 4. Area allotted to the assembly of any one subroutine. 5. Subroutine reference tables. 6. Cross reference (*Fumnies') table. Items 1 and 2 are fixed in the compiler Item 1−341 words to allow for references in the range 0 − 1011 Item 2−392 words to allow for a total of approximately 4000 V stores. Item 3 is set by the heading sheet of the program being compiled. Item 4 is set in the compiler. It is 1341 and is the maximum permitted length of one subroutine by the compiler. This value can be altered. (See DIVISION M). Items 5 and 6 are expanded or contracted by the compiler. The length of the main program is not limited by Item 4. NO/SE is caused by Items 4 and 5 meeting and is usually preceded by S/R LIST SHIFTED UP (DOWN). Confirmation Reports program identifier BIN PROG ON DISC indicates that the program has been successfully compiled and written to the disc. This is followed by the Y spec. (i.e. the message 'Y' SPEC Eaaaa') on the next line. PROG ENDS E ddddd This message is typed if Y0=Ee was used in the program where e is the address that Y0 would have assumed if Y0=Ee had not been used. D. OWN CODE OPTIONS AND REQUIREMENTS None available or required. KDF9
original
6 − 28 − 0 Section 6.4(cont.) E. PROGRAM CHARACTERISTICS General: This is a segment of the PROMPT System written in USERCODE. Method: The source program is read from disc and is processed in two parts. The first part consists of the heading sheet up to and including the program title. The second part consists of the remainder of the heading sheet and the source program proper, terminated by "FINISH;",° Also, all the program, including library subroutines, must be included before the "FINISH;→". Processing The compiler first processes the heading sheet and if Heading Sheet: it finds any error or inconsistency at all in this part of the program, the compilation is terminated, and control returns to Phase Control. Processing In processing the source program proper, the Compiler Text: checks every Usercode instruction for validity and consistency. If an instruction passes the checks it is translated into machine code (as far as possible and stored in the next location in the core store. If a check fails then the instruction is ignored, a failure report is output, and the Compiler moves on to the next instruction. Having processed all the instructions in this way (up to "FINISH") a process called "UPDATE" is performed. This completes the compilation by entering absolute machine addresses in place of the Usercode references (the former may not have been available on the Compiler's first pass). This updating process is also carried out whenever the © label LlVv or PpVv is encountered in the source program, since a new set of reference tables is started at these points. Again, if inconsistencies are found, failure reports are output. Thus, at the end of the run a complete list of invalid instructions, if any, is available. Whether failures have occurred or not the Y0 specification will be given (on the Iine Printer). If there were no invalid instructions, the compiled program and reference tables, if required, will be output to the disc and printer respectively. Output of The compiled program will be laid out in standard 640 word Compiled B and C block form. Program: F. COMPUTER REQUIREMENTS AND CONDITIONS See Section 6.1 Division F. G. NORMAL OPERATING PROCEDURES See Section 6.1 Division F. KDF9
original
6 − 29 − 0 Section .6.4(cont. ) 6.4 H. NORMAL CORRECTION PROCEDURES Not Applicable. J. ABNORMAL OPERATING PROCEDURES See Section 6.1 Division J. K. Not Applicable L. TIMING DATA See Section 621 Division Ll. M. EXTENSIBILITY The maximum permitted length of one subroutine is currently 1341 words, This value can be altered, and the correction message to enlarge it is COREECT KAZ84−−−−−US4; 0/P (L (8→ BEFORE LINE SET 740; + ;→ REPLACE 1 LINE BY SET n ; + ; J625;→ CHECK 624;→ Where n = (the value of largest S/R wanted) − 601. KDF9