202
4
4 Instructions4.5.4 Data Rotation and Shift
◆
Function
n1 word variables from head address D are shifted n2 word places to the right, to accommodate n2 word
variables from head address S that ll the higher words. The instruction of the pulse execution type is
generally used.
Example:
Overflow
Shift of every four bits to the right
X20
ķ
D 13~D 10
ĸ
D 17~D 14 D 13~D 10
Ĺ
D 21~D 18 D 17~D 14
ĺ
D 25~D 22 D 21~D 18
Ļ
D 3D 0D 25~D 22
D25 D24
D0D1
D2
D3
D10D11D12D13
D14
D15D16
D17
D18D19D20D21D22D23
ĺĹĸķ
Ļ
ǒWSFRP D0 D10 K16 K4Ǔ
S
D n1 n2
~
Y 17 Y 16 Y 0Y 1Y 2Y 3Y 4Y 5Y 6Y 7Y 10Y 11Y 12Y 13Y 14Y 15
Ĺ
ķ
Specify the same number of bits when a Kn-type operand is used
X 3 X 2 X 1 X 0
X20
ǒWSFRP K1X0 K1Y0 K4 K1Ǔ
S
D n1 n2
ĸ
ĺ
Ļ
Bits are shifted to the right in the following sequence after every scan:
1˖Y3 -Y0 →
Carry flag
2˖Y17 -Y14 → Y13 -Y10
3˖Y13 -Y10 → Y7 -Y4
4˖Y7 -Y4 → Y3 -Y0
5˖X3 -X00 → Y17 -Y14
completed
WSFL: Word shift left
◆
Overview
When driving conditions are met, the WSFL instruction shifts a combination of word elements with a length
of K1 from head address D to the left by K2 word places, to accommodate a combination of word elements
with a length of K2 from head address S that ll the lower words. The K2 higher words that are moved out
are discarded. The original values in the word element combination S remain unchanged.
WSFL S D n1 n2
Word shift left Applicable model:
H3U
S
Word element
head address
Head address of shifted word elements
16-bit instruction (9
steps)
WSFL: Continuous
execution
WSFLP: Pulse
execution
D
Incoming word
head address
Head address of incoming word elements
n1
Incoming word
count
Number of incoming word elements
n2
Word element
count
Number of shifted word elements