(l) Place 0, 1, 2, 3, ..., 99 respectively in the half
words with addresses A4+i, i = 0 to 99
(2) Compute in the accumulator the product of the n full word numbers
at successive addresses from A10, where preset parameter P26 has been set
to the value n (≥2)
(3a) The full words A17+i, i = 0 to 13+P17, contain half word numbers
xi, yi, where xi is the left half word. Place the sum xi - yi in half word A49,
assuming P17 ≥-13
(3b) Place in B6 the address of the first full word such that xi = yi,
assuming equality does in fact occur
(4) Add to the accumulator the full word numbers stored at addresses
60, 66, 72 , 78, ..., 114
(5) Clear the half words with addresses 1D1 , 3D1, 6D1, 10D1, 15D1, ..., 4950D1
(6) Replace b5 by b52 and b6 by b62P7,
P7 being a
positive integer-valued parameter. Place 1 + b1/b2 in
half word A6, assuming b2 ≠ 0. In all cases assume 24-bit integers
(7)
Suppose that the half words A6+i contain ai, i=0,1, ..., n.
Compute a0x + a1x2 + a2x3
.... anxn+1; where x is
contained in B12 and n = P41 (≠1). Assume ai and x are 21-bit integers
(8) The consecutive half words beginning at A77 hold several numbers less
than P13; count them in B30, stopping after the address of such a number
becomes greater than A90 (≥ A77)
(9) Among the consecutive full words beginning at A13 there is one whose
left half word contains its own address.
Place the address of this full word in B90
(10) Place the sum of ai/bi in A10, where ai, bi are 100 half word numbers
stored consecutively from A1 and A2 respectively.
Finally, place the integer part of that sum in B3.
Allow for intermediate results of up to 35 significant bits
Any constants required such as a zero in the clearing operations
of numbers (11) - (14) should be stored and labelled.
(11) Clear the 100 full words beginning at address A3
(12) Clear the k full words beginning at address S0 where
preset parameter P7 = k and S0 is stored in B12
o April 66,
2/2
(13) Clear the ki (i = 1 to 10) full words beginning at Si,
where the ki are positive integers stored in consecutive half words
from A1, and the Si are full word addresses stored in consecutive half words from
A2
(14) Beginning at half word A7 clear those half words
which contain +1.0 until 1000 half words are clear
(l5a) Consider the following scheme, defining a 'chain list' containing the half word
numbers x0, x1, ... xn
Non-consecutive full word addresses
Contents of left half word
Contents of right half word
a0
x0
a1
a1
x1
a2
a2
x2
a3
.
.
.
.
.
.
an-1
xn-1
an
an
xn
a0
Place the sum of the x's in the half word A3, given that By contains the address a0
(15b) Compress the xi, given above, into the (n+1) half words beginning
at the half word labelled A12. Assume that
the initial addresa a0 = A13
(16) Suppose that ai (i = 0 to n) are floating point numbers
stored in consecutive full words from the full word labelled A1.
Thus ai = (iA1), i = 0 to n. Similarly,
the floating point numbers bi = (iA2), i = 0 to n. The positive
integer n = P7 (preset parameter).
a) Let a0 bk + a1 bk-1 + ... ak b0 = ck
Place in full word A40 the sum c0 +c1 + ... + cn
b) Place in the full word labelled A3 the continued fraction
a0 + b0 / (a1 + b1 / (a2 + b2 / (a3 + b3 / ..... / (an-1 + bn-1 / (an + bn)))....)))
Answers: Modification, Counting and Testing
SOLUTION 2
This solution illustrates a technique that
is sometimes useful, namely direct address
modification. Thus the instruction
114 1 0 -Y4*
adds b1 into the address part of the previous
instruction. The last instruction restores
the address part of the directly modified 113
instruction to its original state.
(16a) Two solutions are given here. In the first, which requires 3n2 + 12n + 10 instructions,
the inner loop evaluates each ck in turn and the sum c0 + .......ck
is accumulated in the
outer loop. The second solution requires 1 + 8n instructions and is based on the observation that the sum
of the ck's is also given by the formula