Mikroone - Online Help
SHR R[x], R[y] - Bit - Shift right
Operating Mode
R[x] := R[y] after rotating one position right, with 0 at the beginning
PC := PC + 1
Description
Rotates all Bits of R[y] one position to the right and fills up with 0 at the beginning.
Saves result to register R[x].
Status Register
Carry - Bit := last Bit of R[y] before shifting
Zero - Bit := 1 if first 15Bit of R[y] are 0
Binary Command
15 14 13 12 11 |
10 9 8 |
7 6 |
5 4 3 |
2 1 0 |
00101 |
Adr(x) |
-- |
Adr(y) |
--- |
Example
SHR R[3], R[6]
15 14 13 12 11 |
10 9 8 |
7 6 |
5 4 3 |
2 1 0 |
00101 |
011 |
-- |
110 |
--- |
.Note
Arithmetic and Logical Commands always affect the Status Bits Carry and Zero.