Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 351

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Data Shift Instructions
Description
Flags
Precautions
318
Area
Indirect DM addresses
in binary
Indirect DM addresses
in BCD
Constants
Data Registers
Index Registers
Indirect addressing
using Index Registers
NSRL(583) shifts D and D+1 (the shift words) by the specified number of
binary bits (specified in C) to the right (from the leftmost bit to the rightmost
bit). Either zeros or the value of the rightmost bit will be placed into the speci-
fied number of bits of the shift word starting from the rightmost bit.
Contents of "a" or
"0" shifted in
Name
Label
Error Flag
ER
Equals Flag
=
Carry Flag
CY
Negative Flag
N
For any bits which are shifted outside the specified word, the contents of the
last bit is shifted to the Carry Flag (CY), and all other data is lost.
When the number of bits to shift (specified in C) is "0," the data will not be
shifted. The appropriate flags will turn ON or OFF, however, according to data
in the specified word.
When the contents of the control word C are out of range, an error will be gen-
erated and the Error Flag will turn ON.
If as a result of the shift the contents of D +1 is 00000000 hex, the Equals Flag
will turn ON.
If as a result of the shift the contents of the leftmost bit of D +1 is 1, the Nega-
tive Flag will turn ON.
D
@ D0 to @ D32767
*D0 to *D32767
---
---
---
,IR0 to ,IR15
-2048 to +2047 ,IR0 to -2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,
(
)IR0 to,
(
)IR15
– –
– –
Shift n-bits
Operation
ON when the control word C (the number of bits to shift)
is not within range.
OFF in all other cases.
ON when the shift result is 0.
OFF in all other cases.
ON when 1 is shifted into the Carry Flag (CY).
OFF in all other cases.
ON when the leftmost bit is 1 as a result of the shift.
OFF in all other cases.
Section 3-8
C
Specified values only
DR0 to DR15
Lost

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents