6F3B0250
7. Instructions
FUN 080
RTR
n bit rotate right
Expression
Input
Function
When the input is ON, the data of register A is rotated n bits to the right (LSB direction), and stored in B. After the operation, if the right most bit (LSB) is ON, the output is turned ON.
Execution condition
Input |
| Operation | Output | CF |
OFF | No execution | OFF | - | |
ON | Execution | When LSB = 1 | ON | Set or reset |
|
| When LSB = 0 | OFF | Set or reset |
Operand
| Name |
|
| Device |
|
|
|
|
|
| Register |
|
|
|
| Constant | Index | ||
|
| X | Y | R | S | T. | C. | XW | YW | RW | SW | T | C | D | I | J | K |
|
|
A | Source |
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö |
n | Shift bits |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 - 16 |
|
B | Destination |
|
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö |
| Ö |
Example
When X007 is changed from OFF to ON, the data of RW18 is rotated 5 bits to the right and the result is stored in RW20.
The figure below shows an operation example.
*
(MSB)
(LSB)
F E D C B A 9 8 7 6 5 4 3 2 1 0
RW18
RW20
(Result)
0 | 1 | 0 | 0 | 0 |
| 0 |
| 1 |
| 0 |
| 1 | 0 |
| 0 |
| 1 | 1 | 0 | 1 | 0 |
| |||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| CF |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1 | 1 | 0 | 1 | 0 |
| 0 |
| 1 |
| 0 |
| 0 | 0 |
| 0 |
| 1 | 0 | 1 | 0 | 0 | 1 |
* | R001 is turned OFF |
|
192 T1/T1S User’s Manual
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net