Section 3.2

Group 2

These instructions perform some arithmetical or logical operation between the 48-bit content of the pseudo-register numbered Y and (with the exception of the 23- and 24-instructions) the 48-bit word x.

With function-numbers 20, 21 and 22 both words are regarded as signed numbers while with function-numbers 25, 26 and 27 both words are regarded as logical quantities.  The functions numbered 23 and 24 use only the content of the pseudo-register.

The contents of the pseudo-registers cannot be altered, with the following exceptions:-

  1. Pseudo-registers 4,5,6 and 7 reflect the current state of the overflow indicator for the program currently being obeyed; reference to either 4 or 5 causes the overflow indicator to be left clear.

  2. Pseudo-registers 18 and 19 reflect the current settings of the hand-switches. These may be altered at will by the operator.

  3. 2 and 3 contain Local Civil Time and thus their contents change with time.

The pseudo-register address is taken modulo 32; if the result is 20 or greater then the content is taken as 048 if the address is even, and as 148 if the address is odd.

Generally, an instruction of group 2 is similar to the corresponding one in group 0 but with pY in place of y.

Function number 20  [0010 000]

(3)  z' = x + pY                    (2)  x' = x + pY

Form the sum of x and pY, writing the result into Z or X.  OVR is set if the result is out of range.

Function number 21  [0010 001]

(3)  z' = x – pY                    (2)  x' = x - pY

Subtract pY from x, writing the result into Z or X.  OVR is set if the result is out of range.

Function number 22  [0010 010]

(3)  z' = pY – x                    (2)  x' = pY - x

Subtract x from pY, writing the result into Z or X.  OVR is set if the result is out of range.

*Function number 23  [0010 011]

(3)  z' = -pY                       (2)  x' = -pY

Negate pY, writing the result into Z or X.  OVR is set if and only if either Y = 10 (p10 = -1.0) or Y= 18 or 19 and the handswitch settings are such that p18 or pl9 = -1.0.  In 3-address form X is irrelevant and therefore it is recommended that this instruction should be used in 2-address form only.

*Function number 24  [0010 100]

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

Copy pY into Z or X.  OVR cannot be set by this instruction.

In 3-address form X is irrelevant and therefore it is recommended that this instruction should be used in 2-address form only.

Function number 25  [0010 101]

(3)  z' = x & pY                    (2)  x' = x & pY

Perform the logical operation 'and' between x and pY, writing the result into Z or X.  OVR cannot be set by this instruction.

For a fuller discussion of the logical operations see Section 3.2.1.

Function number 26  [0010 110]

(3)  z' = x Ú pY                    (2)  x' = x Ú pY

Perform the logical operation 'or' between x and pY, writing the result into Z or X.  OVR cannot be set by this instruction.

For a fuller discussion of the logical operations see Section 3.2.1.

Function number 27  [0010 111]

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

Perform the logical operation 'not equivalent' between x and pY, writing the result into Z or X.  OVR cannot be set by this instruction.

For a fuller discussion of the logical operations see Section 3.2.1.


3.2.1   The Logical Operations.

The logical operations provided by function-numbers 05, 06, 07, 15, 16, 17, 25, 26 and 27 are as follows:-

i)     AND (&).

Given two operands a, and b, form the result c = a & b by placing in the result a 1-bit in those digital positions where both a and b have 1-bits.  All other positions in the result have zeros.  Thus if a and b are 4-bit words, e.g.

                                      a = 1100
                                      b = 0110
then the result is c = a & b = 0100

ii)    OR (Ú).

Given two operands a, and b, form the result c = a Ú b by placing in the result a 1-bit in those digital positions where either a or b or both have a 1-bit, placing zeros in all other positions.

Thus if          a = 1100
and               b = 0110
then c = a
Ú b = 1110

iii)     NOT EQUIVALENT ().

Given two operands a and b, form the result c = a b by placing in the result a 1-bit in those digital positions where the bits in a and b are not the same (i.e. where one has a 1-bit and the other a 0-bit) and placing zeros in the result in all other positions.

Thus if           a = 1100
and               b = 0110
then c = a
b = 1010

 

*  Functions 23 and 24:

2-address type, x is read but not used.

3-address type, X is not checked for lockouts or reservation  violation unless replaced (see 2.2.23 and 2.2.24)