
6F3B0253
7. Instructions
FUN 068
SHR1
1 bit shift right
Expression
Input − [ SHR1 A ]− Output
Function
When the input is ON, the data of register A is shifted 1 bit to the right (LSB direction). 0 is stored in the left most bit (MSB). The pushed out bit state is stored in the carry flag (CF = S050). 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 | Operation data |
|
|
|
|
|
|
| √ | √ | √ √ | √ | √ | √ | √ | √ |
|
| √ |
|
Example
When X007 is changed from OFF to ON, the data of RW15 is shifted 1 bit to the right.
The figure below shows an operation example.
(MSB) | (LSB) |
RW15
RW15
(Result)
F E D C B A 9 8 7 6 5 4 3 2 1 0 |
|
| ||||||||||||||||
0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| CF |
0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | ||
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| R001 is turned ON |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164