Show pageBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. {{htmlmetatags>metatag-description:(GIN Reference Manual - Chapter 2 GIN Input and Output)}} ====== 2 GIN INPUT AND OUTPUT ====== ===== 2.0 GIN's use of peripherals ===== GIN can use the following peripherals:\\ Input ([[gin::chapter2#2.1 Input|Section 2.1]]):\\ * Card readers * Tape readers * Magnetic tapes. Output ([[gin::chapter2#2.2 Output|Section 2.2]]):\\ * Magnetic tapes. Backing store ([[gin::chapter2#2.3 Backing Store|Section 2.3]]): * Drum * Discs under UDAS * EDS * FDS. Listing ([[gin::chapter2#2.4 The Output Listing|Section 2.4]]): * Line printers. It is possible to use up to eight each of card readers, tape readers and magnetic tapes at one time, as long as no more than eleven are used at one time taking all these devices together.\\ ([[gin::chapter7#7.5 Controlling Peripherals|Section 7.5]]) describes the directives which control peripherals. ===== 2.1 Input ===== GIN is capable of receiving input from cards, paper tape and magnetic tape. When GIN is loaded it reads source initially from cards or paper tape, depending on - The entry point used and - The device it was loaded on. After the #CORE directive has been read, other directives may be used to open, close and position magnetic tapes, to allocate card and tape readers, and to cause GIN to read from them. If GIN was loaded from a magnetic tape, this tape is initially open as MT0 and is positioned immediately after the end of GIN.\\ The formats in which GIN expects to receive its input are described below. ==== CARDS ==== The first 72 columns only of input cards are used. The last eight columns may contain any characters, such as sequencing, but they are not checked.\\ ([If a hyphen "-" is present in column 72 of a card, GIN will assume that the next card is to be taken as a continuation of the same logical source record and not as a separate source record. The first column of the following card is taken as following the 71st column of the card containing "-". No more than seven cards may be concatenated in this way.])<sup>*</sup> ==== PAPER TAPE ==== Records on paper tape may be up to 128 characters, but only the first 72 characters (after the elimination of shifts and expansion of tabs described below) of the source line will be read. In some GIN versions a line which is too long will be error-flagged, but GIN will nevertheless attempt to compile it.\\ Beta-shift characters are treated as their alpha-shift equivalents. All delta shift characters except for the following are ignored:\\ | $ | Converted to its internal code equivalent | | ] | Converted to its internal code equivalent | | ↑ | Converted to its internal code equivalent | | TC<sub>4</sub> | End the current line of input | | newline | End the current line of input | | ← | Causes the current line of input, including any characters between ← and TC<sub>4</sub> or newline, to be ignored. | | tab | Causes spaces to be generated so that the next character appears in the next tabulation position. These positions are the same as for PLAN, that is columns 7, 13, 16, 36, 60 and 72. Tabulations beyond this point are prohibited. | ([Irrespective of the length of an individual record on paper tape, if its last character is a hyphen "-" the next record is treated as a continuation of the same logical source record. The first character of the following record is taken as following the character which preceded "-". No logical record formed by the concatenation of physical records may exceed 500 characters.])<sup>*</sup> ==== MAGNETIC TAPE ==== Input on magnetic tape must be in subfile format. The compiler will deal with all the source in a simole subfile, or with all the simple subfiles in a composite subfile. It is not possible to make GIN ignore one of several simple subfiles as such, although #SKIP can be used to ignore any or all of its contents. In GIN 512 onwards GIN will assume that no subfile contains more than one segment. Thus source on magnetic tape should form an integrated stream, relying on GIN's comprehensive facilities for selecting the required code. GIN keeps a count at all times of the current subfile level, which it prints to the left of the page number on each page of the output listing, and if this count becomes zero GIN generates and obeys a #FINISH directive and thus returns to the slow peripheral previously in use.\\ Within a subfile blocks are expected not to exceed 512 words (or such other size as may have been specified by a #BLOCKSIZE directive), and they must be in standard record format. That is, each block will consist of one or more complete records, the first word of each record giving its total length in words. The length of a record may not exceed 21; if it is between 21 and 29 the line is error-flagged L, if over 29 GIN halts FX on the assumption that it has gone wrong. This generally indicates a hardware failure. The end-of-subfile sentinel of a simple subfile must contain a correct block-count; in the end-of-subfile sentinel of a composite subfile the block count is ignored.\\ If it is intended to use #SINCE or #SUMMARY, words 8 and 9 of each start-of-simple-subfile sentinel must contain a date in character format dd/mm/yy. This date is taken to be the date on which the subfile was last edited. ([Any subfile in which word 12 of the subfile sentinel contains the characters B2Gn (where n is any digit) will be specially treated by GIN for listing purposes as described in [[gin::chapter2#2.4 The Output Listing|Section 2.4]]])\\ Each record on magnetic tape is treated as a card image ([; in particular, if the 72nd character of a record is a hyphen "-" the next record is treated as a continuation as described for cards. The effect of a hyphen in character 72 of the last record of a subfile is undefined])<sup>*</sup>. ===== 2.2 Output ===== The formal output from GIN consists of dumps on magnetic tape. Section 11.2 describes the formats of such dumps, and ([[gin::chapter4#4.3 Dumping the Compilation|Section 4.3]]) the directives which produce them.\\ GEORGE is frequently loaded from the program file left behind by GIN, which is described in [[gin::chapter2#2.3 Backing Store|Section 2.3]].\\ There is also a listing on one or two line printers, which is described in [[gin::chapter2#2.4 The Output Listing|Section 2.4]].\\ The user is at liberty to write interludes to punch his compiled program to cards or paper tape or to dump it on a direct access device in standard format. An interlude to dump on cards or paper tape which should be sufficient for normal purposes is given in Section 10.6.2. ===== 2.3 Backing Store ===== GIN uses two backing-store files, each of which may be on disc or drum or may be simulated in core. (Throughout this manual, "disc" or "direct access device" includes any device operating under Unified Direct Access Standards and any exchangeable or fixed disc operating under Basic Direct Access Standards; "drum" does not include high-speed drums.)\\ The program file is used to hold the compiled program. On drum or in core in the old format (types 9 and 0) it is held as a continuous stream of words; on disc and in the new formats (types 10 and 1) each new overlay starts at the next 128-word boundary. A new overlay starts whenever GIN encounters #SEGMENT outside an overlay or #BASE anywhere. On drum, GIN will use a previously existing file of the required name if and if not will create a file; on disc, GIN accepts possible, the first file having the correct name. In either case, #NAME is used to specify the name of the file if it is not GEORGE THREE. On discs, the bucket size must be 128 words.\\ The workfile is opened as a scratch file of the size requested on the appropriate device; it is always organised in "blocks" of one bucket, which is at present 128 words. It is extended as far as necessary to reach the requested size if there is room, but if GIN cannot extend the file enough it carries on with whatever is available. ===== 2.4 The Output Listing ===== The mount of output produced on a line printer by GIN is governed principally by the #LIST directive. There are five available levels from 4 (the most comprehensive) to -1 (hardly anything). Level 4 will describe everything input by the compiler, including ignored lines and all the macro source. Level 3 is most commonly used, and will print every line compiled except for directives in macro definitions which do not cause a word to be inserted in the program. Levels 2 and 1 are intermediate between 0 and 3. Level O lists only the names of segments, the values of universals and compilation errors. Level -1 suppresses the listing of universals. The listing level is kept in 17 (17 is one of the compiler variables, which are described in ([[gin::chapter3#3.4 Expressions|Section 3.4]])).\\ The GIN output listing is specifically designed to provide as much information as possible to the user. It makes full use of a 120-print-position line printer. === THE PAGE HEADER LINE === Reading from left to right the header line corresponds to the contents of the compiler variables 39? to 68? inclusive, as described in ([[gin::chapter3#3.4 Expressions|Section 3.4]]). It thus gives the following information: * The time Updated on each page. * The date Of the current run, and up to two previous runs if applicable. * The name of the current input tape. * The current subfile name. * The current segment name. * The current subfile level. * The page number. The dates on the listing can be confusing at first sight. In an original compilation (one which did not start by restoring a dump) the left-most position will contain the current date. When a dump from an original compilation is restored, the left-most position is unaltered and the new date is placed in the centre position. When a dump 'of such a run is restored (i.e. in a second-order restore) the third or right-most position is used, so that the three dates on the page header are (from left to right) the original compilation, the first-order restore and the second-order restore. In a third-order restore the date replaces that of the original compilation, and subsequent nth-order restore dates replace the dates of the (n-3)th-order restore.\\ GIN will throw to a new page and print a header: - If the number of lines on the present page is equal to the compiler variable expression 187+1]+23] (normally 56, but the user may alter it). - On compiling either of the directives #END and #PAGE at listing level 3 or 4. - When an interlude calls the subroutine 187+2]+5], which starts a new page. === THE OUTPUT LINE === Positions 1 to 80 are the same for all lines printed to list source input lines. Positions 81 to 120 differ as between stored words and other source lines.\\ Positions 1 to 80\\ ^ Print Position ^ Contents ^ | 1 | W indicates a use of a #WRONGed identifier | | 2 | @ indicates a forward reference. | | 3 | A letter indicates that an error has been found in a source line; see Section 9.2. In some exceptional cases the presence of two or more errors may cause other characters to appear. | | 4 | Blank | | 5-8 | The line number within the subfile on magnetic tape, or in the present sequence of card or paper tape input records. If over 9999 the digits after the fourth are lost. | | 9-80 | A copy of the source line, except where one source line gives rise to two or more stored words all of which are printed. If the source of the line was a macro, the first character of the line is indented to position 33 onwards. If the line is in error, the name of the current subfile is printed in positions 69 to 80. | Positions 81 to 120: Stored words ^ Print Position ^ Contents ^ | 81-86 | The core address of the word in decimal. | | 87-93| The core address in octal preceded by *. Users are advised to avoid addresses exceeding 256K. | | 94 | Blank. | | 95-102 | The stored word in octal. | | 103 | Blank. | | 104-6 |The 3-digit octal order code for the stored word treated as an instruction. Replaced branches, and direct branches to addresses exceeding 16383, will cause one to be added to the last digit: e.g. a replaced CALL is printed as 071.| | 107 | Blank. | | 108 |The X field of the stored word. | | 109 |If the instruction is modified, the modifier field. | | 110 |For non-branch instructions and for branches in #ORDINARY mode, blank. For relative branches, an *. For replaced branches, an R. | | 111-5| For #ORDINARY branches, a decimal number not exceeding 32767. For relative branches, a signed decimal number in the range -8192≤n≤8191. For replaced branches, a decimal number not exceeding 16383. For shifts, a decimal number not exceeding 1023 followed by the shift type in position 115: 0 for circular, 1 for logical, 2 for arithmetic, 3 for SRAV. For other instructions, a decimal number not exceeding 4095. | | 116 | Blank. | | 117-120 | The stored word as four characters. | Positions 81 to 120: Non-stored words.\\ For certain directives these are all blank.\\ For labels and the directives listed below, the layout is as follows unless the number printed would be zero, when the fields are left blank: ^ Print Position ^ Contents ^ | 81 to 84 | Blank. | | 85 to 92 | The appropriate number in decimal. | | 93 to 98 | Blank. | | 99 to 106 | The appropriate number in octal. | | 107 to 120 | Blank. | The numbers printed are as follows: | Labels |The address of the label. (Note that this only applies to labels not followed by a stored word.) | | #BASE | The overlay base address. | |#BIP, #DELETE, #DUMP, #GO, #RESTORE | The total number of compilation errors. | |#CORE | The amount of core actually obtained. | |#DEFINE| The value set | |#END|If a segment was being compiled for the first time rather than being mended, its length.| |#ENTRY | The core address of the entry || |#GAP|The length of the gap. | |#LIST |The length of the gap. | |#MANDATORY|The core size obtained. | |#MEND|The program file address of the segment. | |#OPTIONAL|The actual value of the identifier | |#OVERLAY|The entry point. | |#PRINT |The program file address of the segment. | |#REPEAT|The value of the expression. | |#SEGMENT |The program file address of the segment. | |#SKIP |The expression value if non-zero. | === OTHER PRINTER OUTPUT === At the end of each segment, a listing of the values of locals in the segment is given if the listing level is at least 2. Unset locals are printed at listing levels other than -1. The format of this output can be affected by the #FORMAT directive.\\ In the same way, a listing of universals is also given at #DELETE and other terminating directives if the listing level is at least 1. Unset universals are printed at listing levels other than -1. The #FORMAT directive is used in the same way as for locals. Outside a segment or mend a complete list of universals can be obtained with the #UNIVERSALS directive.\\ Terminating directives also produce a list (one to a line) of segments #INCLUDEd but not compiled.\\ When the end of a magnetic tape is reached, GIN will print #FIN#FIN#FIN... all across the page.\\ In Executive GIN only, a branch generated to avoid a forbidden area is flagged by BRN BRN BRN ... in the source line fie!d.\\ The #SUMMARY directive can be used to obtain a second listing which gives the name and date of editing of each subfile encountered, all erroneous lines, all #SEGMENT and #END directives, etc. == THE #SINCE DIRECTIVE == This facility is provided to allow the user to print all subfiles where the source has recently been edited. Any subfile edited since the date given in #SINCE is listed as if the listing level were 3; LIST directives are compiled and remembered, and at the end of the subfile the most recent one is implemented. If a #SUMMARY listing is in progress, the names of subfiles so listed are flagged on that listing with four asterisks.\\ ([There is one exception to this rule. If word 12 of the subfile sentinel contains B2GO or B2G3, and the date in words 8 and 9 is later than the #SINCE date, and the #SINCE date is not 00/00/00, and 27? contains the value 4, then the subfile will not be listed unless the ordinary listing level justifies it, but its name will be flagged on the summary listing.\\ The following are the recommended interpretations of word 12: | Zero |Non-GEORGE code, or GEORGE code using the default options. | | B2G0 | GEORGE code common to GEORGE 3 and GEORGE 4 and containing no skips on G3 or G4 either directly or within macro expansions. | |B2G3 |GEORGE 3 only code. | |B2G4 |GEORGE 4 only code. | |B2G7 |Code which compiles differently in GEORGE 3 and GEORGE 4. | |Other |Undefined.| Thus the practical effect of this is that listings of certain subfiles common to GEORGE 3 and GEORGE 4 are not produced in the standard compilation of GEORGE 4. Note also that code will eventually be included to notify the user if word 12 of a subfile is set incorrectly.])<sup>*</sup> ([GIN 513 onwards])* Last modified: 17/01/2024 11:55by 127.0.0.1 Log In