|
Re: Manipulating bits
One word of warning about the PIC, though it probably doesn't apply in your case if you're just using shifts for bit manipulation. Right shifts are unsigned only. So if you have a signed int that you want to divide by 4, x >> 2 only works if the value is positive. A negative value will have 0 shifted into the high order bits and will end up looking like a positive number.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|