Syntax
VAR16 >>= N
|
shift VAR16 right by N
|
VAR32 >>= N
|
shift VAR32 right by N
|
PROD >>= N
|
shift PROD (product reg.) right by N
|
Operands | VAR16: integer variable |
VAR32: long or fixed variable
PROD: 48-bit product register
N: shift factor
Binary code
Description | The operand is right shifted with the specified number of bits (N). High order bits are sign-extended and the low order bits are lost. If the operand is PROD, the entire 48-bit product register is right shifted. |
Execution | Variable = Value of variable shifted to right with N bits |
Example1 int Var1;
...
Var1 >>= 4;
Before instruction
|
|
After instruction
|
Var1
|
0x1256
|
|
Var1
|
0x0125
|
Example2 long Var1;
...
Var1 >>= 12;
Before instruction
|
|
After instruction
|
Var1
|
0x1256ABAB
|
|
Var1
|
0x0001256A
|
Example3 PROD >>= 4;
Before instruction
|
|
After instruction
|
Product register
|
0x12560000ABCD
|
|
Product register
|
0x0012560000ABC
|
|