236
Shift Instructions Section 5-16
Description When the execution condition is OFF, ASFT(17) does nothing and the pro-
gram moves to the next instruction. When the execution condition is ON,
ASFT(17) is used to create and control a reversible asynchronous word shift
register between St and E. This register only shifts words when the next word
in the register is zero, e.g., if no words in the register contain zero, nothing is
shifted. Also, only one word is shifted for each word in the register that con-
tains zero. When the contents of a word are shifted to the next word, the origi-
nal word’s contents are set to zero. In essence, when the register is shifted,
each zero word in the register trades places with the next word. (See Example
below.)
The shift direction (i.e. whether the “next word” is the next higher or the next
lower word) is designated in C. C is also used to reset the register. All of any
portion of the register can be reset by designating the desired portion with St
and E.
Control Word Bits 00 through 12 of C are not used. Bit 13 is the shift direction: turn bit 13
ON to shift down (toward lower addressed words) and OFF to shift up (toward
higher addressed words). Bit 14 is the Shift Enable Bit: turn bit 14 ON to
enable shift register operation according to bit 13 and OFF to disable the reg-
ister. Bit 15 is the Reset bit: the register will be reset (set to zero) between St
and E when ASFT(17) is executed with bit 15 ON. Turn bit 15 OFF for normal
operation.
Note If the non-differentiated form of ASFT(17) is used, data will be shifted every
cycle while the execution condition is ON. Use the differentiated form to pre-
vent this.
Flags ER: The St and E words are in different areas, or St is greater than E.
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
Example The following example shows instruction ASFT(17) used to shift words in an
11-word shift register created between DM 0100 and DM 0110 with C=#6000.
Non-zero data is shifted towards St (DM 0110).
ASFT(17)
#6000
DM 0100
DM 0110
00000
Address Instruction Operands
00000 LD 00000
00001 ASFT(17)
# 6000
DM 0100
DM 0110
DM 0100 1234 1234 1234
DM 0101 0000 0000 2345
DM 0102 0000 2345 3456
DM 0103 2345 0000 4567
DM 0104 3456 3456 5678
DM 0105 0000 4567 6789
DM 0106 4567 0000 789A
DM 0107 5678 5678 0000
DM 0108 6789 6789 0000
DM 0109 0000 789A 0000
DM 0110 789A 0000 0000
Before
execution
After one
execution
After seven
executions