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