SHR
Syntax
Operation
Data Types
Description
Shifts the destination word operand op1 right by as many times as specified by the source operand op2.
The most significant bits of the result are filled with zeros accordingly. Since the bits shifted out effectively
represent the remainder, the Overflow flag is used instead as a Rounding flag. This flag together with the
Carry flag helps the user to determine whether the remainder bits lost were greater than, less than or
equal to one half an least significant bit. Only shift values between 0 and 15 are allowed. When using a
GPR as the count control, only the least significant 4 bits are used.
Flags
E
0
E
Always cleared.
Z
Set if result equals zero. Cleared otherwise.
V
Set if in any cycle of the shift operation a '1' is shifted out of the carry flag. Cleared for a shift
count of zero.
C
The carry flag is set according to the last least significant bit shifted out of op1. Cleared for a
shift count of zero.
N
Set if the most significant bit of the result is set. Cleared otherwise.
Addressing Modes
Mnemonic
SHR
SHR
Shift Right
SHR
(count)
(C)
(V)
DO WHILE (count) ≠ 0
(V)
(C)
(op1
)
n
(op1
)
15
(count)
END WHILE
WORD
Z
*
Rw
, Rw
n
m
Rw
, #data
n
4
ST10 FAMILY PROGRAMMING MANUAL
op1, op2
<-- (op2)
<-- 0
<-- 0
<-- (C) v (V)
<-- (op1
)
0
<-- (op1
)
[n=0...14]
n+1
<-- 0
<-- (count) - 1
V
S
Format
6C nm
7C #n
C
N
S
*
Bytes
2
2
113/172
Need help?
Do you have a question about the ST10 Series and is the answer not in the manual?
Questions and answers