394
7 APPLICATION INSTRUCTIONS
7.3 Shift Instructions
1-bit shift to right of n-bit data, 1-bit shift to left of n-bit data
BSFR(P), BSFL(P)
■BSFR
• Shifts the data in n points from the device designated by (D) to the right by one bit.
• The device designated by (D)+(n-1) is filled with 0.
■BSFL
• Shifts the data in n points from the device designated by (D) to the left by one bit.
• The device designated by (D) is filled with 0.
(D): Head number of the devices to be shifted (bits)
n: Number of devices to which shift is executed (BIN 16 bits)
Setting
data
Internal device R, ZR J\ U\G Zn Constant
K, H
Others
Bit Word Bit Word
(D)
n
Basic
Process
High
performance
Redundant
Universal
LCPU
Command
Command
P
D
n
D
n
BSFR, BSFL
BSFRP, BSFLP
indicates an instruction symbol of BSFR/BSFL.
DD
0
Carry flag
(SM700)
Filled with 0
110 110
0 11 0 1
1
n
D D D D
DD D D D D
+(n-1)+(n-2)+(n-3)
+(n-1)+(n-2)+(n-3)
+2
+1
+2
+1
DD D D D D
DD D D D D
1
Carry flag
(SM700)
Filled with 0
110011
1 00 11
0
+(n-1)
+(n-2)+(n-3) +2 +1
+(n-1)
+(n-2)+(n-3) +2 +1