207
4
4 Instructions 4.5.4 Data Rotation and Shift
SFL: 16-bit data shift left with carry by n bits
◆
Overview
The SFL instruction shifts the 16 bits of a word element to the left by n bit places.
SFL S n
16-bit data shift
left with carry by
n bits
Applicable model:
H3U
S
Word to be
shifted
Number of the element that stores the data to be
shifted
16-bit instruction (5
steps)
SFL: Continuous
execution
SFLP: Pulse
execution
n Shift times Number of shift times; value range: 0 ≤ n ≤ 15
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
n X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
The 16 bits of the word with the carry ag in the element [D] are shifted n bit places to the left.
n is a number in the range 0 to 15.
When n ≥ 16, bits are shifted by a number of bit places calculated by n%16 (remainder). For example,
when n = 20, bits are shifted four bit places (20%16 = 4) to the left.
The 1/0 state of the nth bit in [D] is written to the carry ag M8022.
The n bits starting from the lowest bit in [D] are lled with 0s.
1 1
1
1 0 0
1 1
0 0
bit0
1
0 0
1
1 1 1
bit1bit15bit14 bit13bit12 bit11bit10bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2
D
0 0
0
0 1 1
1
1
0 0
bit0
0
0
0 0 0
bit1bit15bit14 bit13bit12 bit11bit10bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2
D
0
n=8
M8022
Changed to 0
Carry flag
An error is returned in the following condition. The error ag M8067 is set to ON to identify this error and
the error code is stored in D8067.
Error 6706 is returned when n < 0.