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

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Data Shift Instructions
Flags
Precautions
Examples
316
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 discarded.
When the number of bits to shift (specified in C) is "0," the data will not be
shifted. The appropriate flags will turn ON and 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 is 0000 hex, the Equals Flag will
turn ON.
If as a result of the shift the contents of the leftmost bit of D is 1, the Negative
Flag will turn ON.
When CIO 0.00 is ON, CIO 1000 will be shifted 10 bits to the right (from the
leftmost bit to the rightmost bit). The number of bits to shift is specified in bits
0 to 7 of word D300. The contents of bit 15 of CIO 1000 is copied into the bits
from which data was shifted and the contents of the leftmost bit of data which
was shifted out of range, is shifted into the Carry Flag (CY). All other data is
lost.
0.00
1000
D300
15
12
11
8
C: D300
8
0
Always 0.
Data shifted into register
8 Hex: Contents of leftmost bit shifted in
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.
7
4
3
0
0
A
No. of bits to shift: 10 bits (0A Hex)
Section 3-8

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents