Applicable program areas operands, Flags function sample program, 2 instructions – Omron SYSMAC CP CP1E-N@@D@-@ User Manual
Page 170: Operand specifications
2 Instructions
2-134
CP1E CPU Unit Instructions Reference Manual(W483)
ASR
Applicable Program Areas
Operands
Operand Specifications
Flags
Function
Sample program
Instruction
Mnemonic
Variations
Function
code
Function
ARITHMETIC SHIFT RIGHT
ASR
@ASL
026
Shifts the contents of Wd one bit to the right.
Symbol
ASR
Area
Step program areas
Subroutines
Interrupt tasks
Usage
OK
OK
OK
Operand
Description
Data type
Size
Wd
Word
UINT
1
Area
Word addresses
Indirect DM addresses
Constants
CF
Pulse bits
TR bits
CIO
WR
HR
AR
T
C
DM
@DM
*DM
Wd
OK
OK
OK
OK
OK
OK
OK
OK
OK
---
---
---
---
Name
Label
Operation
Error Flag
P_ER
OFF
Equals Flag
P_EQ
• ON when the shift result is 0.
• OFF in all other cases.
Carry Flag
P_CY
• ON when 1 is shifted into the Carry Flag (CY).
• OFF in all other cases.
Negative Flag
P_N
OFF
ASR(026) shifts the contents of Wd
one bit to the right (from leftmost bit to
rightmost bit). “0” will be placed in the
leftmost bit and the contents of the
rightmost bit will be shifted into the
Carry Flag (CY).
When CIO 0.00 is ON, word CIO 100 will
shift one bit to the right. “0” will be placed in
CIO 100.15 and the contents of CIO 100.00
will be shifted to the Carry Flag (CY).
Wd: Word
ASR(026)
Wd
0
0
15
CY
ASR
100
0.00
Wd
0
15
1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
0
CY
0
1
Wd: 100CH
1 0 0 1 0 0 0 1 0 0 0 1 0 0 0