This section consists of a number of detached and rather trivial tricks and precepts, which are nevertheless considered worth while having in writing.
It is seldom that one writes down a page of instructions for the first time without having forgotten a few vital instructions. It is therefore considered desirable to aim, not at pages which are chock-full, but say at ones which are about five-eighths full. The extra space is best left between sequences of consecutive instructions, so that once sequence may be extended without interfering with another. The spaces can also be filled with numbers if desired, when the discovery of mistakes calls for retrenchment. In this connection see also sandwiching. Another useful way of using reserve space is to put in a number of dummy stops or of time wasting instructions, or hoots. The latter provide `rhythm clicks' which are very informative concerning the progress of the routine.
It is never too soon to learn the meanings of the 64 functions [i.e., the opcodes]. The way to do so is to start programming in teleprint code straight away. Keep a list of the meanings always at hand, and refer to it as much as you wish: you will find that after a week very few references are necessary. You will not yet know all the codes, but you will know a `working selection'. Likewise you will eventually get to know the teleprint equivalents (p. ), but this is likely to be slower, chiefly because it is less essential to know them. Although the lines are given names which are in teleprint code, and which also correspond to numbers, for many applications particularly the ones which do not use `systematic storage space', it is not necessary to know anything concerning the relation of these labellings, or even to have very much to do with the numbers at all. The names of the lines are just used as labels. Later it will be desirable to know the teleprint equivalents of the single characters by heart, but it is never necessary to know the equivalents for pairs of characters.
One of the commonest operations is a sequence of instructions to be repeated a given number of times. Sometimes the sequence is in two successive parts of which the first is to be omitted on the first round
It is frequently desirable to subtract something other than 1. This may be because the number of repetitions is the result of a computation, and is given with some factor applied, e.g. a power of two. Alternatively it may be desired to save a line by setting the B line with some quantity already available, e.g. to count 12 one might set GC/J into the B tube, and subtract ///E, the former being supposed an instruction which is used in any case, the latter available in PERM.
When two cases have to be given quite different treatment, involving different sequences of instructions, it is natural to choose the relevant sequences by a test instruction (i.e. conditional transfer /T, /H, /M, or /O). When there is a large number the best method is to manufacture a control transfer number which will lead to the appropriate sequence. A good example of this is in the input programme where the six warning characters have to be given six different treatments, and the remaining twenty-six are given a seventh. This is dealt with as follows. If is the character in question /// is set to B6, and the instruction //IP given. The lines // to £/ contain the seven control transfer numbers appropriate to the thirty two possible values of and the sequence required is immediately entered.
When the B tube is used for the transfer of 20 digits from one short line to another, and both locations are fixed and known to the programmer, there is no difficulty. The difficulty arises when one of the short lines is in an indeterminate position, i.e. one computed by the machine, for it is usual to keep such indeterminate positions in a B-line, and the instructions involved will therefore presumably have to refer to two B-lines, one being the shunting station, the other describing the indeterminate position. To be more specific suppose that a quantity can easily be determined and that it is desired to set . How should this be done? The instruction OKQO will effect . We need to follow this with , which can be achieved either by the instruction GIPZ when or by GIIZ when . There is a school of thought which maintains that a difference between presumptive and actual instructions in respect of the function number is to be deplored, and that the former instruction is therefore to be preferred to the latter. The instructions TT, TZ, TL were introduced in deference to this view; they do not improve speed or reduce space, but they may save a little programmer's time. When doing the reverse process, e.g. setting the situation is usually rather simpler. One can set and follow this with GIQT and OKQB.
Note: If , is achieved with and presumptive instruction .
If the operation to be repeated contains rather few instructions e.g. three, and is crucial for the speed of the whole process it may be best to omit the instructions concerned with counting and to repeat the instructions concerned with the process in question the requisite number of times. Sometimes the number of repetitions may be the result of calculation, but even then the omission of counting method may still be applied, the number of repetitions being controlled through a control transfer entering the sequence of repeated operations at the appropriate point.
It is often necessary to have a number of routines differing in certain minor particulars. One would like to use essentially the same instructions for all of them. The most convenient method seems to be to use one assembly of instructions, with various points of entry. The cues of these routines will then differ only in their first ten digits.
The instruction DSTJ has the effect which for most purposes is as good as which can only be achieved in two instructions, or more if 80 digits are required.
It is often sufficient to specify tabular numbers to twenty digits only. One might for instance wish to have values of for from 1 to 32 with an error of not more than . This can be achieved by putting e.g. . Then .
The beginner is liable either to leave things in the accumulator to get mixed up with the next calculation or else to put in accumulator clearing instructions which could easily have been avoided. In fact it is very seldom necessary to give a special instruction for clearing the accumulator, if the points below are held in mind.
We have explained that the economising of instructions in order to reduce the space occupied in the magnetic store is seldom worth while. There are however occasions when it is worth while to economise them to save space in the electronic store. This is nearly always in order to get instructions either into one page or into two pages. To do so makes the routine tidier, and usually has time-economy effects. For instance a one-page routine may be combined with another one-page (master) routine which uses it again and again without losing time over magnetic transfers. In these cases the two routines are able to be in the electronic store together, one on one page and one on the other. This effect can also be achieved by the disagreeable device of borrowing part of the systematic working space (if available) for part of the master routine. If a routine occupies more than two pages then (unless the same objectionable shift is relied on) it must involve magnetic transfers, and consequent loss of time. To some extent then the considerations mentioned under `manoevring space' may be overruled, though they generally apply for routines of three or more pages. Some possible economy measures are described below.
Of course an economy measure which simply reduces the number of instructions in a straight sequence will normally be a time economy as well. We have mentioned two or three devices for keeping the number of instructions down, but this will mostly be learnt by experience.
The chief space economy measure available other than reducing the number of instructions is the use of a line for more than one purpose. One or two forms of this have already been mentioned. It is usual for instance to use addressless instructions (p. ) also as control transfer numbers. Another case was mentioned under the head of counting. No attempt can be made to list all such devices, but there are a number associated with control transfer numbers. These are sufficiently numerous that it should nearly always be possible to avoid using any lines specially for control transfer numbers. To make a point of doing so in cases where it is not strictly necessary is however strongly to be discouraged, as liable to lead to a most wasteful use of programmers' time. The methods already known to be available are mentioned below.
If a (short) line is sandwiched between two sequences of instructions, the instruction which uses that short line can also be used as a control transfer number for the beginning of the later sequence of instructions. A long line can only be used in this way if it ends with a pair of characters representing a harmless instruction. Lines ending with T£, Z£, ..., ££ are almost the only suitable ones.
If a dummy stop or other addressless instruction be placed immediately before a `junction', (i.e. an instruction to which a control transfer is made, but which is not the beginning of a straight sequence) then this addressless instruction may be used as a control transfer number in the usual way, and the control transfer instruction may also be used as a control transfer number for the transfer to the junction. This position will not however always be suitable from other points of view.
Relative transfers (e.g. /Q) are more troublesome to use than absolute ones, but provide a second string. The necessary relative transfer number may sometimes be found in PERM, or if part of the routine itself is being used as special working space, it may be found in the routine itself.
If a line pair is required to be known to more than twenty but less than thirty binary digits, the first two characters of the line pair used may be changed to a control transfer number. Likewise if a number is required to less than ten digits a control transfer number may also be concealed in it.
This is another space economy measure but not concerned with control transfer numbers. Suppose that the same sequence of instructions is to be used twice in different connections, but with one instruction changed. It may be worth while to use the same actual sequence of instructions. The troublesome instruction may be altered with a B line e.g. if the two effects required are IKT¼ and IKTF they may be achieved with the instruction IEZ¼, B1 having as content either /C// or /C/S.
A few devices which are almost purely computational, having little connection with the machine, may also be mentioned. One of these is a method of obtaining reciprocals if a number are required at once. The simplest case is where two are required, e.g. and . One can get them with only one use of the reciprocals routine, using it only to obtain and multiplying by or by to obtain or . Any number of reciprocals may be obtained in a similar way with only one use of the reciprocals routine, but all the numbers to be inverted must be known before any reciprocal can be obtained. Best accuracy is retained if the numbers are brought to `standard form' i.e. to between and 1 before the process is applied.
The number of terms to be taken in a power series may often be reduced by the use of Tchebysheff polynomials. The Tchebysheff polynomial of degree is given by
The coefficients of the polynomials may be calculated by using the recurrence relations [as documented in the ms., not yet checked]