Operand1 ShiftOperator Operand2
Shift Rule
If either of the Operand is Negative don't forget to calculate its 2's complement since Negative integers is stored in Memory using 2's complement
Mask Operand2 with 0x1F
Right shift 81814621>>-12 = 78 81814621>>>-12 = 78 OK!! Right shift (Operand1 is NEGATIVE) -81814621>>-12 = -79 -81814621>>>-12 = 4017 Why different?
Left shift
21<<-12 = 22020096
-21<<-12 = -22020096
Unlike Right shift no matter Operand1 is Positive/Negative
only sign get changed instead value
Thanks for all of your support! now i have a better idea on it...:)