Titan has 120 B-registers (modifier registers or index registers) which can be used for address modification, for integer arithmetic, or for logical operations. The B-arithmetic unit is independent of, and can operate at the same time as, the floating-point accumulator. In addition to the ordinary B-registers there are some special registers (see Section 3.12) which are treated as B-registers. These include the accumulator exponent and the sequence control register, so that instead of having special jump orders, jumps are achieved by setting the sequence control register using normal B-orders.
A further group of orders, the test orders, carry out operations on a specified B-register if a particular condition is satisfied (see Section 3.9). This mechanism provides conditional jumps, but is also of use in its own right. A further set of orders, the test-and-count orders, facilitate programming of loops.
Most B-orders can have a singly-modified address: most test orders cannot have a modified address since the instruction itself must refer to two B-registers (one to be tested and the other to be set). However, when the test does not involve a B-register (e.g. accumulator sign), the address can be singly modified.
B0 always contains zero, and writing to it has no effect. B1 to B119 are 24-bit registers which may be regarded as holding an address, an integer or a set of logical quantities. B120-127 are special purpose registers (see Section 3.12). Ordinary programs should use B-registers 1 to 80 inclusive. (B91-119 are by convention reserved for system programs. There is no check on the use of these B-registers by ordinary programs, and the system will not be harmed if they are so used. However, their contents are likely to change in an unpredictable manner during execution of a program, so that they are not of any real use to the ordinary programmer.)
The B-arithmetic unit treats the contents of a B-register as a 24-bit positive integer: addition is carried out modulo 224, and subtraction is effected by adding the two's complement.
By convention a B-register is usually regarded, for arithmetic purposes, as holding a 21-bit integer with an octal fraction, the most significant digit being a sign digit and two's complements used for negative numbers. However, the contents can equally well be regarded as an integer of 23 bits plus sign, or even as a 24-bit positive integer (though in this use, of course, sign discriminations are meaningless). Although overflow is ignored in B-arithmetic, the carry out of the B-adder can be sensed by extracode (see Section 3.11).
B-register number q is denoted by Bq. For its contents a small b is used, thus
bq | ≡ | contents of Bq |
b1 | ≡ | contents of B1. |
A B-order is written in the usual way
F Ba Bm S
Ba is the B-register to be operated on, Bm either specifies another operand B-register, or modifies the address. The effective address is used in different ways by different orders. It can be
or
Note that s-type B-orders refer to half-word addresses in store.
120 | ba' | = | n-ba |
121 | ba' | = | n |
122 | ba' | = | ba-n |
123 | ba' | = | -n |
124 | ba' | = | ba+n |
100 | ba' | = | s-ba |
101 | ba' | = | s |
102 | ba' | = | ba-s |
103 | ba' | = | -s |
104 | ba' | = | ba+s |
110 | s' | = | s-ba |
111 | s' | = | -ba |
112 | s' | = | ba-s |
113 | s' | = | ba |
114 | s' | = | ba+s |
107 | ba' | = | ba∧s | ||
117 | s' | = | ba∧s | ||
127 | ba' | = | ba∧n | ||
165 | ba' | = | bm∧n | ) | address cannot be modified |
164 | ba' | = | ba+bm∧n | ) |
N.B. If Bm = 0, the 165 order behaves as a 121 order, and the 164 order behaves as a 124 order. However, 164 and 165 work as expected if bm = 0.
147 | ba' | = | ba∨s |
167 | ba' | = | ba∨n |
106 | ba' | = | ba ≢ s |
116 | s' | = | ba ≢ s |
126 | ba' | = | ba ≢ n |
The following circular shifts are provided:
105 | ba' | = | 26ba + s |
125 | ba' | = | 26ba + n |
143 | ba' | = | 2-1ba - s |
163 | ba' | = | 2-1ba - n |
Note that an arithmetic shift one place left can be obtained by doubling, thus:
124 6 6 0
B127 is the control counter, therefore jumps are achieved by setting B127, e.g.
121 | 127 | 0 | x | jump to x |
101 | 127 | 44 | y | jump to position specified in dictionary, indexed by B44 |
214 | ba' = n | if | bm = 0 |
215 | ba' = n | if | bm ≠ 0 |
216 | ba' = n | if | bm ≥ 0 |
217 | ba' = n | if | bm < 0 |
210 | ba' = n | if | least significant digit of bm = 1 |
211 | ba' = n | if | least significant digit of bm = 0 |
234 | ba' = n | if | xa = 0 |
235 | ba' = n | if | xa ≠ 0 |
236 | ba' = n | if | xa ≥ 0 |
237 | ba' = n | if | xa < 0 |
200 | ba' = n, | bm' = bm + 0.4 | if | bm ≠ 0 |
201 | ba' = n, | bm' = bm + 1 | if | bm ≠ 0 |
202 | ba' = n, | bm' = bm - 0.4 | if | bm ≠ 0 |
203 | ba' = n, | bm' = bm - 1 | if | bm ≠ 0 |
Note that the test on bm is made before the count, and that if bm = 0 nothing is done, i.e. once a count reaches zero, it stays there. If Bm = 127, counting does not take place.
The B-test register, called Bt, enables tests to be made on a B-register and the result stored for a later discrimination: it also enables a B-register to be tested without destroying its contents. The orders which set Bt carry out a B-register subtraction and record the result (positive, negative or zero) in Bt: a complete range of test codes is provided to discriminate on the content of Bt.
150 | bt' | = | s-ba |
152 | bt' | = | ba-s |
170 | bt' | = | n-ba |
172 | bt' | = | ba-n |
220 | ba' = n, | bm' = bm+0.4 | ) | if bt ≠ 0 |
221 | ba' = n, | bm' = bm+1 | ) | |
222 | ba' = n, | bm' = bm-0.4 | ) | |
223 | ba' = n, | bm' = bm-1 | ) |
(If Bm = 127, counting does not take place)
224 | ba' = n | if | bt = 0 |
225 | ba' = n | if | bt ≠ 0 |
226 | ba' = n | if | bt ≥ 0 |
227 | ba' = n | if | bt < 0 |
Note the correspondence with the orders 200-203 and 214-217. Note also that 224-227 can have a singly-modified address.
The B-carry digit, Bc, records the carry out of the B-adder on an arithmetic operation. It is set by those B-codes whose last digit is 0, 2 or 4, and can be sensed by extracode 1223 (see Chapter 5).
With the exception of B90, B121, B124 and B127, programs will not normally use B-registers above B80. However, a list is given here for completeness.
B0 | Always zero | |
B1-B80 | Object programs | |
B81-B89 | Library routines | |
B90 | Subroutine link | |
B91-B99 | Extracodes | |
B100-B112 | Supervisor | |
B113-B118 | Interrupt routines | |
B119 | Extracode operand address | |
B120 | Always zero | |
B121 | ) | Substitution register (see below) |
B122 | ) | |
B123 | Interrupt priority decoder | |
B124 | Accumulator exponent (see Chapter 4) | |
B125 | Interrupt control counter | |
B126 | Extracode and Supervisor control counter | |
B127 | Main control counter |
B121 and B122 allow indirect addressing of B-registers. If Ba=122 in an instruction, the B-register whose number is held in B121 is used as Ba. Note however that B121 consists of digits 8-2, thus
121 | 121 | 0 | 32.4 |
... | |||
356 | 122 | 0 | (3) |
causes the address of the 356 order to be modified by the contents of B65. Note also that B121 is changed whenever an extracode is obeyed, and that Bm = 122 does not cause modification of the address.
B124 consists of digits 23 - 15 only. It contains the 8-bit accumulator exponent in digits 22 - 15; negative exponents are stored as 2-s complements, so that d22 acts as a sign bit. Digit 23 is a guard digit; when setting B124, digit 23 should be the same as digit 22.
Copyright © 1965-1966 University of Cambridge Computer Laboratory. Distributed by permission. Thanks to Barry Landy, Roger Needham and David Hartley for giving permission to distribute these documents. Thanks to Barry Landy for lending me the paper document from which this was scanned. Any typographical errors probably arose in the course of OCR.
Previous chapter: Chapter 2: The Titan Computer
Next chapter: Chapter 4: The Accumulator Orders
Return to TITAN Machine-Code Programming Manual
Return to CUCPS TITAN page
Return to CUCPS home page
Return to University of Cambridge home page