7-53
SFTBR(P),SFTBL(P)
1
2
3
4
6
6
7
8
7.3 Shift instruction
7.3.3 n-bit shift to right or left of n-bit data (SFTBR(P),SFTBL(P))
Program Example
(1) The following program shifts the data of Y10 to Y17 (8 bits) specified by to the right by 2
bits (n2), when M0 is turned on.
[Ladder Mode] [List Mode]
[Operation]
(2) The following program shifts the data of Y21 to Y2C (12 bits) specified by to the left by 5
bits (n2), when M0 is turned on.
[Ladder Mode] [List Mode]
[Operation]
D
Step
Instruction
Device
10111001
Y10Y11Y12Y13Y14Y15Y16Y17
Y10Y11Y12Y13Y14Y15Y16Y17
00101110
0
Carry flag
(SM700)
D
Step
Instruction
Device
010111011 001
Y21Y22Y23Y24Y25Y26Y27Y28Y29Y2AY2BY2C
001001011 000
Y21Y22Y23Y24Y25Y26Y27Y28Y29Y2AY2BY2C
0
Carry flag
(SM700)