Section 3.8

Group 8

The instructions in this group fall into three logically distinct sub-groups, respectively concerned with:-

  i)   (80 to 83) counting, and stepping modifiers.
 ii)   (84 and 85) searching for specified characters.
iii)   (86 and 87) entering and leaving subroutines.

3.8.1  Function numbers 80 to 83

By means of these functions a counter may be increased or decreased by unity each time a loop of instructions is obeyed until that loop has been traversed the desired number of times;  this event is indicated by the value of the counter reaching some specified value.

In 3-address form the counter is the integer in accumulator Z, while in 2-address form it is the integer in register Y:  if the counter is in an accumulator it may also be used as a modifier within the loop (or elsewhere).

The completion of the cycling process is determined, in 3-address form, by comparing the new value of z with the value of Y and, in 2-address form, by comparing the new value of y with zero.  In making these comparisons only the modifier half of z or y is taken, limiting the value of the counter to 224-1 (16 million).

The value of Y may be set as the address field of the written instruction, in which case it is a 15-bit quantity, or by replacement or pre-modification, when it is a 24-bit quantity.

Function number 80  [1000 000]

3-address:  z' = z + 1;  jump to X if zm' = Y
2-address:  y' = y + 1;  jump to X if ym' = 0

Increase the counter by unity and jump if the result is equal to Y (3-address) or zero (2-address).  OVR is set if z' (or y' ) is out of range.

Function number 81  [1000 001]

3-address:  z' = z + 1;  jump to X if zm' Y
2-address:  y' = y + 1;  jump to X if ym' 0

Increase the counter by unity and jump if the result does not equal Y (3-address) or zero (2-address).  OVR is set if z' or y' is out of range.

A particular use of this instruction is in connection with a 'loop' which is to be obeyed once only.  For example, a print sub-routine may be used repeatedly but the layout of the printed page may require that the action the first time the routine is used shall differ from the action on subsequent occasions.  If, then, a counter is set initially to -1, an 81-instruction can be used to secure the alternative actions.

 

Function number 82  [1000 010]

3-address:  z' = z-1;  jump to X if zm' = Y

2-address:  y' = y-1;  jump to X if ym' = 0

Decrease the counter by unity and jump if the result is not equal to Y (3-address) or zero (2-address).  OVR is set if z' or y' is out of range.

 

Function number 83  [1000 011]

3-address:  z' = z-1;  jump to X if zm' Y

2-address:  y' = y-1;  jump to X if ym' 0

Decrease the counter by unity and jump if the result is not equal to Y (3-address) or zero (2-address).  OVR is set if z' or y' is out of range.

 

3.8.2  Function numbers 84 and 85

These two functions are used to determine whether or not a certain 6-bit character is present in a word.  The character sought is specified by its value in the chosen internal code; this value is written as the Z-address in the instruction.  The hardware then tests each of the successive 6-bit fields in y for equivalence with Z.  The instructions indicate only whether the character is present or not; they give no indication regarding the number of times that character appears in the word, or its position within the word.

If the instruction is of 2-address type then Z is treated as zero and the character SP is sought.

 

Function number 84  [1000 100]

3-address:  Jump to X if character value Z is in y
2-address:  Jump to X if character SP is in y

Function number 85  [1000 101]

3-address:  Jump to X if character value Z is not in y
2-address:  Jump to X if character SP is not in y

3.8.3. Function numbers 86 and 87

86- and 87- instructions are designed primarily for entering and leaving sub-routines.  In both cases, the 2-address form is the more conventional.  In 3-address form Y is irrelevant and is not checked, for lockouts or violation of reservations unless replaced (see 2.2.23 and 2.2.24)

Function Number 86  [1000 110]

3-address:  zm' = c + 1,  zs' = OVR, OVR' = 0, jump to X
2-address:  ym' = c + 1,  ys' = OVR, OVR' = 0, jump to X
where c = control number (address of current instruction).

Enter subroutine at address X, leaving in ym or zm the address of the word following the 86- instruction.  Before jumping, set the sign bit of y or z to 1 if OVR is set or to 0 if OVR is clear, leaving OVR clear.   The address left in y or z is the link for use by an 87- instruction in the subroutine.

An 86- instruction gives an unconditional jump and can be used as such if it is desired simultaneously to ensure that OVR is cleared.

The X- and- Y- addresses can be replaced or modified if desired: replacement or modification of the X-address permits the subroutine to be entered at a variable address from the same point in the main program.

A three-address 86- instruction can be used to enter a subroutine and set a fifteen-bit parameter (in the Y-address) for use within the subroutine.  Thus if the 86-instruction is
86    SUB/E    PARAM    SUB/L

then the parameter can be copied into X1 by:
04Y     X1     -1     L

In this case the register holding the link must be an accumulator.  Note that this copies the whole 86-instruction into X1: it does not isolate the parameter.

Function Number 87  [1000 111]

3-address:  OVR' = OVR zs,  jump to X + zm
2-address:  OVR' = OVR ys,  jump to X + ym

Leave subroutine: on entry to the subroutine by an 86-instruction, zm or ym was set to contain the address of the next word.  Thus, when an 87-instruction is obeyed within the subroutine, an unconditional jump occurs to the word X+1 words after the 86-instruction.  Also the state of overflow when the 86-instruction was obeyed, is recorded in the sign bit of y or z.  If OVR was set immediately before entry to the subroutine and/or OVR is set (and not subsequently cleared) during execution of the subroutine, then OVR is left set after obeying the 87-instruction, otherwise OVR is left clear.

The X- and Y-addresses can be replaced or modified if desired: replacement or modification of the X-address permits return to the main-program at a variable address.