Applied Instructions
《Arithmetic shift left》
《Arithmetic shift right》
Function &
Action
z After once execution, the
high bit is same with the bit
before shifting, the final bit
is stored in carry flag.
z After once execution, the
low bit is filled in 0, the
final bit is stored in carry
flag.
[SHL] & [SHR]
16 bits instruction:SHL、SHR 32 bits instruction:DSHL、DSHR
Suitable Models:
XC3、XC5
Note:
z In the left example, when X1 is ON, left/right shift is executed at every scan cycle.
Word
Device
Bit
Device
D
FD
DM
DX
DY
DS
TD
CD
K/H
D·
n
X
Y
M
S
T
C
Dn.m
101