Sld/srd, Applicable program areas operands, Flags function – Omron SYSMAC CP CP1E-N@@D@-@ User Manual
Page 175: Precautions, 2 instructions, Operand specifications
2-139
2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Data Sh
ift I
n
stru
ctio
ns
2
SLD/SRD
SLD/SRD
Applicable Program Areas
Operands
Operand Specifications
Flags
Function
SLD
SLD(074) shifts data between St and E by one digit (4 bits) to the left. “0” is placed in the rightmost digit
(bits 3 to 0 of St), and the content of the leftmost digit (bits 15 to 12 of E) is lost.
SRD
SRD(075) shifts data between St and E by one digit (4 bits) to the right. “0” is placed in the leftmost digit
(bits 15 to 12 of E), and the content of the rightmost digit (bits 3 to 0 of St) is lost.
Precautions
Instruction
Mnemonic
Variations
Function
code
Function
ONE DIGIT SHIFT LEFT
SLD
@SLD
074
Shifts data by one digit (4 bits) to the left.
ONE DIGIT SHIFT RIGHT
SRD
@SRD
075
Shifts data by one digit (4 bits) to the right.
Symbol
SLD
SRD
Area
Step program areas
Subroutines
Interrupt tasks
Usage
OK
OK
OK
Operand
Description
Data type
Size
St
Starting Word
UINT
Variable
E
End Word
UINT
Variable
Area
Word addresses
Indirect DM addresses
Constants
CF
Pulse bits
TR bits
CIO
WR
HR
AR
T
C
DM
@DM
*DM
St,E
OK
OK
OK
OK
OK
OK
OK
OK
OK
---
---
---
---
Name
Label
Operation
Error Flag
P_ER
• ON when St is greater than E.
• OFF in all other cases.
• St and E must be in the same data
area.
• When large amounts of data are
shifted, the instruction execution
time is quite long. Be sure that the
power is not cut while SLD(074) and
SRD(075) is being executed, caus-
ing the shift operation to stop half-
way through.
SLD
SRD
SLD(074)
St
E
E: End word
St: Starting Word
SRD(075)
St
E
E: End word
St: Starting Word
E
S
t
Lost
0Hex
E
S
Lost
t
0Hex