/* flip all bits except between range defined by startBit and numBits to left*/ /* bit numbering like: 7 6 5 4 3 2 1 0 */ inline unsigned short flipNotInRange (unsigned short in, int startBit, int numBits) { unsigned short result; result =(~in) ^ (~((unsigned short) ~0<