-20-

    (3b) (it can) Enter the sub-program at the correct point.

    If D0 of the Link word was zero, indicating a Busy/Lock-Out
    type sub-program suspension, on re-entry to the sub-program
    the parameters in the 2nd word of the triad are left in Q5.
    The sub-program is re-entered as soon as the core area specified
    in I5 and M5 is not locked-out, and the device whose number is
    given in C5 is not busy (if C5 is zero this second check is not
    performed.   Hence, if Q5=0, immediate entry to the sub-program.
    is assured, since words 0-31 are never Locked-out).

    If D0 of the Link -word was 1, indicating that the sub-program
    wanted to be allocated a magnetic tape, re-entry to the sub-
    program is via EXIT 1 if the tape is permanently unavailable
    (operator answers 'N' to 'wanted' query), and via EXIT 2 if the
    required tape has been found and allocated - its unit number is
    left in C6.

    (4) Once the sub-program has been re-entered it proceeds until
    one of 5 things happens-

       (a) it ends itself in such a way that control passes to the
           next sub-program. A sub-program is "dead" if its Link
           word contains zero. If it jumps to /RESP/, the link
           word will be cleared and step (3a) (above) entered as
           required.

       (b) it ends itself, but without passing control to succeeding
           sub-programs.   It might, for instance, go to the program
           failure routine /RW8/ and thence to /RW9/. The sub­
           program must clear its own link word (by, e.g., ZERO;
           =M0M7;) and, if /REDT/ is not going to be set anyway by
           what follows, make /REDT/ non-zero so that the succeeding
           sub-programs are not cheated of their turn.   They will
           thus be re-entered after the Director reaches /RW9/, when
           /REDT/ is next examined.

       (c) the sub-program may deliberately suspend itself until the
           next EDT.   To do this, it obeys JS/RWL9/; this has the
           effect of putting the necessary link in the Link word
           (which is positive), and zero in the 2nd word, and going
           to step (3a), above.   If it is desired to artificially
           simulate the arrival of the EDT, the sub-program obeys
           JS/RWL8/ which, as well as pertertiaing the operations
           described above, sets /REDT/ non-zero - thus a hold-up in
           a sub-program may be arranged for any reason by including
           its own test, though if /REDT/ is set artificially there
           is of course no chance of returning to the program.

       (d) the sub-program may, if necessary, suspend itself if any
           peripheral device is busy and/ or any core area is
           locked-out, by obeying JS/RWL5/ with the correct parameters
           (described above) in Q5.   If either of the conditions apply,
           the link and parameter word are stored away in the table
           and step (3a) is obeyed; but if neither apply the sub­
           program is resumed immediately.

       (e) the sub-erogram may require to be allocated a magnetic
           tape with a given 1- or 2-word identifier.   It must obey
           JS/RMAU/ with this identifier in N1, or N1 and N2. When
           the subprogram is resumed (immediately if the tape is
           available) the identifier will have been erased.


-21- If the tape is not immediately available, subsequent entries to /RWL2/ will only look for the required tape if a marker /RNID/ is non-zero: this is set whenever a new tape is loaded. This marker is also set by TINT H. It is cleared after all sub-programs have been examined, prior to returning to /RW9/. The link (negative) and identifier are stored in the sub-program parameter table by /RMAU. When a sub-program takes any of the 5 actions described above, it should not assume that any parameters in Nesting Store, Q-stores or SJNS will be preserved except those specifically mentioned above. In a Busy/Lock-out hold-up, the 3rd word of the parameter table (E2M7) is available and sometimes most useful for the storage of additional parameters. It is not available during a "mag. tape allocation'' hold-up, even if the required identifier is only 1 word long. Only a sub-program may transfer control to one of the lables mentioned above, as they all assume Q7 to be correctly set up. This implies that only a sub-program may be allocated a magnetic tape. To initiate a sub-program it is necessary only to set up Q7 with the parameters for that sub-program, and obey JS/RW118/ (see (c) above). This may only be done in a sequence of instructions leading naturally to /RW9/, in phase 2. If it is not possible to set up Q7 (because, e.g., one is already in another sub-program) one must deliberately set /REDT/ non-zero (if necessary), set the desired positive link in the appropriate link word, and clear the second word of the triad. 6.3 Usage of Sub-programs If the first sub-program, whose parameters are stored in the three words starting /SHU/, is active, i.e. /SHU/ is non-zero, the program is suspended. Therefore, this sub-program is used to handle those activities in which hold-ups imply that the program must also be held- up: specifically program termination and input, the allocation of magnetic tapes to programs, and, in OUT 8, the suspension of a program until a transfer which is locking-out the output area ends. Other sub-programs (there is only one, used by OUT 8, but there is nothing to prevent the use of more) handle activities which, though requiring suspension from time to time, do not necessarily have to suspend the program. Pseudo-off-line working is an obvious example. It is possible, however, for any sub-program to cause the suspension of the program, by setting bits in /HUR/. Different bits are used by different sub-programs - conventionally the second (OUT 8) sub- program uses D47, the next one will use D46, etc. Given the appropriate bit in N1, the subroutines /SUSP/ and /CLSP/ respectively set and clear it in /HUR/. A typical example of how this feature is used is provided by OUT 8. OUT 8 blocks are output by Director using the second sub-program. D47 is set in /HUR/ until the transfer actually starts, when it is cleared. During the transfer the program is prevented from corrupting the information being transferred by the normal store lock-out - when this is removed at the end of the transfer, EDT is set and the Director re-entered. If a parity failure occurs necessitating skipping back and rewriting the block, the bit is reset in /HUR/ and removed again when the transfer is restarted.
-22- At the end of the program, the termination process (which is organised by the first sub-program) sets a marker which the second sub-program recognises, and accordingly "winds up" the OUT 8 process. The first sub-program suspends itself (as under 4(c) above) until this marker is cleared. The first sub-program then clears /HUR/ altogether. Any routine (except the program termination routine itself) which uses the first sub-program, must be prepared for forcible termination at any time. TINT I0 and TINT A both cause /SHU/ to be cleared, thus abruptly shutting down the first sub-program. TINT A goes on to start up a new first sub-program. /ROUT/ may be used to store markers by the first sub-program. 6.4 W Magnetic Tape bricks Sub-programs are characterised by their peripheral hold-ups being caused by one device at a time, rather than by one of several. There is a class of parallel peripheral operations in which several units may operate under Director. control doing similar functions. These are the "W' magnetic tape operations. When any magnetic tape assumes status W, it must be made to obey a sequence of program "bricks", ending in its status being changed to U or L. A Sub-program is not suitable for this as up to 9 tapes may be in status W at any time. As with sub-programs, the operation on the tape decks are kept going efficiently by the occurrence of EDT at the end of each. The system is best explained by referring to figure 3.

                                        Figure 3,


-23- When /REDT/ is found to be non-zero, control is transferred to /RW11/. After clearing /REDT/, a marker /RMTW/ is examined; if' this is non­ zero, it indicates that there are some magnetic tapes in status W. In order to find out whether any of these require attention, subroutine /RPS2/ (5.3) is used to look through the list of units to find W tapes. Each one that it finds is tested for "Busy"; if it is busy, /RMTW/ is set non-zero again and /RPS2/ re-entered; if it is not busy, its parity is checked, and a "brick indicator" is examined to find out which "brick" to enter. Each magnetic tape unit has its own brick indicator (they are stored in /BRIN/ onwards) whose m.s. 24 bits contain at any time a standard floating point number equal to:- ½ (2-a + 2-b + 2-c ....) where a, b, c... are the numbers of the bricks still to be completed. Thus any set of bricks may be specified for any unit; the bricks specified are always obeyed in numerical order. Using the instruction FIX, and a "tree" of jump instructions stored in consecutive ½-words from /RWTR/ onwards, it is easy. to enter the required brick. A brick may be entered any number of times before it is "completed". When left incomplete, it transfers control. back to the point where the control routine looks for the next W unit. When complete, it goes to a routine which updates the brick indicator (by removing D9, and restandardising D0-23), and, if the new indicator is non-zero, returns to the point at which "Busy" on this unit is tested. If the indicator is clear, it is assumed that the last brick has changed the status from W to L or U and the next W unit is sought. A brick may not alter Q6, because it contains the unit parameters required by /RPS2/. The unit number which the brick uses is in C6. Bricks may use Q5 and Q7. D24 of the brick indicator is set to 1 if at any time parity failure is detected during the operations. D25-47 are to hold the block counter used by Brick 0. The subroutine /SETW/ is u ed to alter a tape's status to W, and start it off with a given brick indicator (specified to the subroutine shifted down 33 places). When there are no more bricks to enter, the Director goes on to deal with sub-programs, as the continuation of the EDT path. The actions of the individual bricks are:- 0: skip back to BT one block at a time, counting the number of blocks. 1: skip back to BT 32,768 blocks at a time (skip is used in preference to rewind, because the latter does not give an EDT interrupt when it reaches BT, and offers no parity check). 2: read the label block. 3: alter the status from W to L, typing out descriptor, identifier, TSN. 4: alter the status from W to U, typing out full details, 5: alter the status from W to U typing out the descriptor only. 6: alter the status from W to L, typing out nothing.
-24- The bricks are entered at /RMBO/, /RMB1/, etc. When the clock or FLEX RFIs occur, subroutine /RWR/ examines all the L and U magnetic tapes to ensure they are/are not on BT. Any which fail the test have their status altered to W, with a suitable Brick Indicator set. Care must be taken when typing out descriptors that this potential status change does not affect what is typed. Bricks 3, 4 and 5 take precaution in this respect, by not typing out the descriptor from where it is normally stored, and holding it in a work store while waiting for the typewriter to become available. The W magnetic tape operations precede the sub-program tests so that any new L tapes produced by the former may be checked against the identifier requirements of the latter without delay. 7. Program failures, termination, and input 7.1 Program failures Failures such as LIV, NOUV, time expiry, and failures in OUTs, transfer control to /RW8/ with the failure indicator in N1. If this contains non-zero bits in D0-38, it is typed exactly as it stands, but if D0-38 are all zero, what is typed is the octal number in D39-44, followed by L, N, T according to which, if any, of D45, 46, 47 respectively are non-zero. After typing,a routine is entered (/RW14/) which causes the contents of the SJNS, N1, and N2 to be typed in the familiar form. This routine is also entered by TINT A+. A marker /RTER/ is next examined. If it is zero, the operator is asked to REACT; and if the answer is not A, an even restart (as in TINT I0) is performed. Otherwise, and if /RTER/ is non-zero, the program is terminated - the "ending number" is the quantity given in /RTER/. 7.2 Program termination All program termination procedures transfer control to /RW23/ with parameters in N1 and N2 which are respectively a "terminator", now stored in /RTER/, and an ending number, now stored in /ROUT/, The first sub-program is initiated regardless of any link already stored in /SHU/) using JS/RWL9/, and control transferred back to /RW9/. The termination routine obeyed in the first sub-program consists of a series of numbered steps, 1 to 9, obeyed in numerical order, though some steps may be omitted in different contexts. The steps to be obeyed are determined by the "terminator" in /RTER/ - in this word, D47 corresponds to step 1, D46 to step 2, etc., and a step is only entered if the corresponding bit of /RTER/ is a 1. Control of steps is performed by a subroutine /RTS/, which shifts /RTER/ cyclically down 1 place, stores the new version, obeys EXIT 1 or EXIT 2 according to whether this is positive or negative. The steps must therefore be placed consecutively in the store, each separated from its successor by a pair of instructions of the form JS/RTS/; J/x/; where /x/ refers to the next pair of this type, after the intervening step. Thus EXIT 1 from /RTS/ causes the next step to be "leap- frogged", EXIT 2 leads directly into it,
-25- 7.3 Termination steps Briefly, the functions of the termination steps are: Step 1 Deallocate peripherals (first clearing any transfers, and setting a brick indicator causing magnetic tape blocks to be counted). Step 2 Type out logging details. Step 3 Empty nesting store and SINS (as described in 2.2.2). Step 4 Terminate OUT 8 procedures, and any other Director-called program transfers (see 6.4). At the end of this step, the core area occupied by the program should not be locked out at all. Step 5 Check and clear lock-outs (any lock-out set is erroneous). Step 6 Read the new A-block. For this purpose the paper tape reader which is next-to-be-allocated is used, but not actually allocated - this is to ensure it remains in this status for allocation either to the program, if read from magnetic tape, or to step 8 for reading in the B- and C-blocks. Step 7 Record the real time for evaluating elapsed time. Step 8 Read in B- and C-blocks, including magnetic tape search if required. This step includes the program input (CRNP) failure routine: this has to distinguish whether or not OUT 1 is in progress, by looking at /RTER/, since it leads to a program failure (/RW8/) rather than restarting the termination procedure. Step 9 Types out details at the start of a new program. A standard final step is always obeyed by any termination sequence: this includes clearing /RDLS/ (to ensure entry at E0) and /RTER/ (which acts as a marker to indicate whether or not termination is in progress). It also stores the new program name in /RCPN/ and /RCPN+1/ where it is accessible to Director. This protects the Director if the program itself corrupts E2 and E3. The first sub-program is ended. 8. Input and Storage of Director 8.1 Input The Director is input, from paper or magnetic tape, using a "call tape" which has to be Input". This comprises;- - An initial "filler" routine, stored in words 0-8, for reading and entering further blocks. - A "setting up" routine, for clearing various registers - this is stored in words 9 onwards. - The routines, stored at the end of the first module of store, for reading the A, B, and C blocks of Director. The C-blocks, which overwrite the B-block, occupy word 0 onward, and are longitudinally sum-checked. The Director is entered (Phase 0) using one of the jumps originally in word 4 of the B-block.
-26- The "programs base address" (/RPBA/) defines the point where the storage of programs will start. Initially the coding of Director extends beyond this point, these being the instructions comprising Phase 0. The only point of interest about Phase 0 is that, after reading in the list of peripherals, Director sets bits in /RCDA/ (which is its own copy of what is stored in CPDAR) corresponding to the non-magnetic tape units. This ensures that when the Director "proper" is entered, at the same point which is reached after a non-"OUT 1" CRNP failure, causing the termination procedure (steps 1, 3, 5, 6, 7, 8, 9) to be instigated, the deallocation process in step 19 which deallocates only the units specified in /RCDA/, will treat all these as if they had been allocated: the result being to give them all status U except for one of each type which becomes N. 8.2 Storage of Director Instructions occupy words 0 onwards. Constants follow, Finally, in separate blocks of 32, come the locations which are used in input/output operations, which must be grouped like this to avoid setting lock-outs on other areas. These blocks are used for:- (block starting /ROBA) some OUT 8 output (block starting /RBUF/) Typewriter messages and queries typed out from these locations. The last two words are used for the output of N1 and N2 by /RTN/, and also for replies to TINT; (block starting /WORK/) Input of index blocks from the program tape (2 words, starting /INBL/) and of label blocks from magnetic tapes (27 words, 5 per unit, starting /LABL/). /RPBA/, the programs base address, is the start of the next block of 32 words. 9. Errors - symptoms and diagnosis This section describes cases in which,. due either. to program or hardware malfunction, Director can lose control of the machine. The cases described are not exhaustive and are based largely on practical experience. 9.1 Failures apparent when Director is input 9.1.1 "Simultaneous peripherals" malfunctioning One of the first occasions on which two peripheral devices are called on to operate simultaneously, occurs when the A-block of the first program is called for on the paper tape reader. At this time a typewriter transfer (usually the descriptor of the lowest numbered peripheral unit) has just been started. It has been observed that when "simultaneity" is malfunctioning the addresses of the typewriter transfer sometimes get confused with the A-block addresses, so the typewriter message is garbled (it usually appears to be outputting a string of spaces, or the A-block itself, if read). 9.1.2 Lock-outs malfunctioning A symptom which has probably been observed at one time or another by all systems test engineers is one which shows itself when lock-outs are not working. A string of typewriter messages will appear. to be typed in such a way that the first is not typed at all and the last is typed twice. This is
-27- because subroutine /RTN/ is used, which parks N1 and N2 in a core buffer as soon as lock-out is cleared, and types it out when the Flexowriter is not busy. If lock-outs are not present this will cause each message of a string to overwrite its predecessor soon after typing of the latter starts, with the result described above. 9.2 Malfunctions which jam the machine up Machines which have not been fitted with the RESET RFI are liable to "seize up" if instructions are obeyed involving jumps to syllables 6 or 7, etc., etc. Such occurrences fall into two classes:- 9.2.1 Program errors If the machine seizes with NIFF not on, a programmer's lapse is indicated: the address of the current instruction should be noted so that the program can be corrected. 9.2.2 Machine errors If NIFF is on (i.e. the Director has been entered) when seizure occurs, something must have happened to upset the normal sequencing of instructions. Usually this is the result of the contents of SJNS being wrongly calculated prior to obeying EXITARr; when the Director is branching to a tree. This the Director does following an OUT, FLEX, or when about to enter a W magnetic tape brick. The sequences of instructions leading to the EXIT could be investigated by single-shotting to discover any malfunctioning instruction. In one actual case the instruction. STAND; used in branching to magnetic tape bricks was found to be leaving a non-zero result after standardising a zero quantity, with dire results (see 6.4). The instructions BITS, FIX and STAND are the most likely offenders. 9.3 Malfunctions which do not permit TINTs If the machine is not jammed when Director loses control, but will not respond to a TINT (i.e. makes no response when the Typewriter Interrupt key is depressed) it is likely that the Director is trapped inside a tight loop waiting for the removal of either a busy or lock- out condition. Such loops are extremely rare: the most likely is the one in /RTN/ which waits for the removal of the lock-out from the 32 words beginning /RBUF/. These loops include entries to /RWR/. (This fact should be borne in mind when single-shotting through them: always single shot until the actual Test (Busy or Lock-out) instruction is found) but do not include /RW9/, so no action is ever taken even if RFIs are found. 9.4 Malfunctions permitting TINTs These are characterised by the ability of the Director to perform all its natural functions except re-enter the Program. Again, there are two classes:- 9.4.1 Sub--program holding up program If /SHU/ or /HUR/ are stuck in a non-zero condition, this indicates a hold-up in a sub-program which is not allowing re-entry to a program. In the simplest case this can arise through an EDT interrupt having been missed: a "TINT F" will
-27- cure this. However, the cause may be more serious, e.g., a lock-out or busy condition not removed. Details of the relevant hold-up may be obtained by examining (using TINT M) the sub-program parameter table, i.e. the set of triads starting at /SHU/. It is also useful to see the contents of /RTER/ if the hold-up is connected with program input. It is wise to first ensure that all peripheral units are in a "ready" condition. (particularly the Line Printer) as an Unready device is an obvious cause of a hold-up. 9.4.2 Program continuously re-interrupted It may occur that /SHU/ and /HUR/ are both clear, so that the Director can enter. Phase 3 and obey EXIT D, but the program is immediately re-interrupted because {usually) of some busy or lock-out condition which is holding it up. This condition can be distinguished from the foregoing by setting "Request Stop" on word 0: if the machine stops, it is proof that, since Phase 1 has been entered, the program has been re-interrupted. It is usually possible to discover the source of the trouble by looking at the instructions being obeyed by the program where the interruption occurs. One very sinister malfunction has been known to occur, with the same symptoms but a different cause; namely, that for some reason a lock-out has been wrongly set up on a part of the Director's area never involved at all in input/ output operations. There is no hope of clearing this and the result is that whenever the Director refers to this area, LOV RFI. is set, and if this occurs in Phase 3, is still set when Director comes to obey EXIT D and therefore precipitates Interruption again. ____________ It cannot be too strongly emphasised - and the cases described above reinforce this - that it is essential that the Lock-out mechanism be in 100% working order if the machine is to perform satisfactorily. If Lock-outs "stick", it is usually possible to clear the trouble by executing TINT A, but this will not usually help if the trouble is a sub-program hold up, or the spurious lock-out mentioned above.