Shift Instructions
Description
Control Word
Flags
Example
00000
236
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.
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.
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.)
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).
DM 0100
DM 0101
DM 0102
DM 0103
DM 0104
DM 0105
DM 0106
DM 0107
DM 0108
DM 0109
DM 0110
Address Instruction
ASFT(17)
00000
LD
#6000
00001
ASFT(17)
DM 0100
DM 0110
Before
After one
execution
execution
1234
1234
0000
0000
0000
2345
2345
0000
3456
3456
0000
4567
4567
0000
5678
5678
6789
6789
0000
789A
789A
0000
Section 5-16
Operands
00000
#
6000
DM
0100
DM
0110
After seven
executions
1234
2345
3456
4567
5678
6789
789A
0000
0000
0000
0000
Need help?
Do you have a question about the CPM1 and is the answer not in the manual?
Questions and answers