The semi-building-in technique is employed when a routine is used sufficiently frequently by different programs to warrant its retention on the drum in a general form for as long as possible. A semi-built-in program (SBIP) can be kept on the drum outside any program's reserved region until the space it occupies is required by some other program. Not more than eight SBIPs can be held in the machine at any one time, but all SBIPs are also permanently stored on the system tape.
Since any SBIP may be used by a number of different jobs, all SBIPs are stored on the drum in a mapped form, and are not relativised until they are brought down into the core store. In order that SBIPs may be read onto the drum as rapidly as possible, the permanent program on the system tape is held in the same form as the program on the drum, both of these programs being in binary. The form used is similar to the binary-and-map form described in section 7.3, except that in the case of SBIPs the whole of the map follows the binary program, the latter being preceded by the chapter change word pairs. A library routine, MAPPER, is provided (q.v.) to convert Basic Input language documents into semi-built-in form. The rules given there must be adhered to for every SBIP.
An SBIP may be called in by a USE (or COM) or READ directive, or by a 150/51 instruction. The specification of an SBIP will indicate which should be used. A list of SBIPs currently in the machine is kept by OMP, and if the called SBIP is on the drum, the directive or instruction will be implemented. If the SBIP has been called by a directive the first chapter will be relativised according to the datum point of the job, brought down into the core store and entered. If a 150/51 is used the chapter specified is relativised, brought down and entered or not, as instructed (see section 5.3.51)
If the SBIP is not on the drum OMP calls a chapter of Basic Input to read the required SBIP from the system tape. This chapter will use registers A64 to A255 of the main program's reserved region and the previous contents of these registers will be lost. If these registers are outside reservations, RES.VIOL will result.
Basic Input may not be able to read the SBIP immediately because there is insufficient drum available to store it, or because there are already eight SBIPs in the machine, or because another (or the same) SBIP is being read in. In any of these cases a message will be printed on the Flexowriter and the program halted. (See section 5.8.2) The program will continue when the reason for the stoppage has been removed. A list of SBIPs on the drum can be obtained by using the NAMES directive (section 126.96.36.199) and an SBIP not in use may be removed from the drum by using a REMOVE directive (section 188.8.131.52). The amount of drum store occupied by SBIPs not in use can be found by using a SPACE directive (section 184.108.40.206)
As soon as the chapter of Basic Input has successfully read in the SBIP, whether it has been halted or not, a message will be output on the Flexowriter (see section 5.8.2) and the required chapter of the SBIP is then transferred to the core store as described above.
The conventions followed in naming any document on the system tape are given in section 6.1.3. SBIPs follow the rules given there, so the document name of the semi-built-in form of a program might be
The first, second and fourth components are defined by convention; the fifth component is the date. The third component cannot contain more than eight characters which must be chosen from the letters, digits and . (point).
This third component, in this example SYMBOLIC, is also known as the semi-built-in name, and is used by itself when an SBIP is called in by a directive, or as the content of the Y address when a 150/51 instruction is used.
An SBIP will be overwritten if the space it occupies is required by another program (except another SBIP) unless it is in use, that is unless it has been called in by a job in the machine. This protection is automatically removed when the job concerned is abolished, or it may be removed before that by a 150/51 instruction (see section 5.3.51)
The following routines are in semi-built-in form