Section 3.3

Group 3

All the legal instructions of group 3 are concerned with multiplication, the range provided allowing for single-length, double-length and accumulative double-length products.

Function-numbers 30 to 34 use as one operand the 48-bit signed number x.  Functions 30 to 33 use also the 48-bit signed number y, while function 33 uses a third operand, namely the double-length signed number z:.

Function 34 uses, as the second operand, the unsigned 15- or 24-bit number Y instead of y.

The function-numbers 35, 36 and 37 are unassigned and are treated as illegal.

Function number 30  [0011 000]

(3)  zI' = xIyI                      (2) xI' = xIyI

Single-length product of integers.   Regarding x and y as signed integers, form their product, writing the result into Z or X.  OVR is set if the result exceeds single-length capacity.

In effect the result of this instruction is the l.s. half of the full double-length product, adjusted to be correctly signed.

If one (or both) of the operands is non-negative and can be represented by 24 bits or less it may be faster to use a 34 instruction (q.v.) with replacement of the Y-address.

Function number 31  [0011 001]

(3)  zF' = (xF.yF)r                               (2)  xF' = (xF.yF)r

Rounded single-length product of fractions.  Regarding x and y as fractions, form their product, rounded to single-length, and write the result into Z or X.  OVR will be set if and only if  xF = yF = -1.0.

When this instruction is obeyed the full double-length product in standard form is formed.  The m.s. half is then rounded by adding 2-47 to it if the l.s. half is equal to or exceeds and is then stored as the result.  Thus the result is that integral multiple of  2-47 which is nearest to the true product of xF and yF and is the algebraically greater if the true product is an odd multiple of 2-48.

Function number 32  [0011 010]

(3)  z:' = xy                       (2)  x:' = xy

Double-length product.  Form the full double length product of x and y, writing the result into Z and Z+1 or X and X+1.  The result is in standard form, i.e. with the l.s. half non-negative.  OVR is set if and only if xF = yF = -1.0.

The consequence of the standard form for the d.l. product are illustrated by the table below.

  x                  y        z' (or x')    z*' (or x*')
+5                 +9            +0            +45
+0.5              +9            +4            +0.5
+5                 -9            -1            247-45
-0.5               +9            -5            +0.5
+0.5              +0.875     +0.4375      +0
-0.5              +0.875     -0.4375       +0

If x and y are both fractions or both integers then the result is a double-length fraction or integer respectively.  If one of the operands is a fraction and the other is an integer then the product is a standard double-length mid-point number.

Function number 33  [0011 011]

(3)  z:' = z: + xy                  (2)  x:' = x: + xy

Accumulative multiplication.  Form the full double-length product of x and y and add it to the double-length number z: in Z and Z+1 (3-address) or to x: in X and X+1 (2-address).  OVR is set if the result exceeds double-length capacity.

The result is left in standard form, i.e. with z*' (or x*') 0 but it is not necessary that z: (or x:) should be in standard form initially since a 'partial justify' operation is performed on z: (or x:).  Overflow caused by the 'partial justify' is dealt with correctly.  In the 2-address form any carry into x caused by the 'partial justify' is not considered in forming the product xy.

It is, of course, essential that the scalings of x, y and z: (or x:) are compatible.  The increment xy and the result are correctly signed.

Function number 34  [0011 100]

(3) z' = xY                         (2) x' = xY

Multiply x by Y, writing the result into Z or X.  Y is an unsigned 15- or 24-bit number while x is a signed 48-bit number.  The result is correctly signed.  OVR is set if the result exceeds single-length capacity.

This function is closely related to the 30.  The result given is, in effect, the signed l.s. half of the full double-length product of two 48-bit words, the m.s. 24 or 33 bits of one of which are all 0's.

Thus, if the content of A100 is regarded as an integer i then the instruction

34     A100    27    A7

will set in A7 the integer equal to 27i.

In certain cases the 34 function can be used instead of the 30.  This is so if at least one of the operands is a non-negative 24-bit number.  Suppose that such a number j is in A200, while in A100 is a signed 48-bit number k.  Then the instruction

34   A100   (A200)    A7

will set in A7 the signed product jk. This may be faster than the direct instruction

30   A100   A200 A7

The function 34, is, of course, designed primarily for multiplication by program constants, e.g. for multiplying pounds sterling by 240 to obtain the equivalent number of pence.

Function number 35  [0011 101]

Function number 36  [0011 110]

Function number 37  [0011 111]

These instructions are illegal.