Chapter 6 Instruction Details
XBC E-Type Main Unit 6-148 Ve r. 1
6.26 Move Instruction
6.26.1 BSFT, BSFTP
Instruction
Step
P M K F L T C S Z D.x
R.x
U N D R
BSFT(P)
3/4 - - -
Start bit of BSFT Operation
End bit of BSFT Operation
1) BSFT (Bit Shift)
(1) Shifts bits data from Start Bit (St) to End Bit (Ed) bit by bit.
(2) Bit shift direction
- S1 < Ed: left shift
- S1 > Ed: right shift
Before
After
b15 b0St Ed
1 0 1 1
0 0 1 0
1 1 1 0
0 1 0 1
1 0 0 1
1 0 0 1 0 1 1 1
0 0 0 1
Discarded
2) Program Example
(1) For P0070=h8000, when Input Signal P00000 is changed to On from Off status, it shifts to the right from
Start bit P0070F to End bit P00704 bit by bit because P0070F is larger than P00704 (P0070F > P00704).
BSFTP P0070F P00704
P00000