
some_value |= ~MASK;    // Set   all bits except the '1' bits in MASK

some_value &=  MASK;    // Clear all bits except the '1' bits in MASK
