It would be difficult for you to find out if the original flag values ββwere set to these bits or not. Say flags were already 0x200 , when your code is executed, then your operation will neither change xOR, nor equal, nor guarantee that the previous value will be restored. The only way I can see is to do this operation in a virtual method and override it in the derived class without any changes. Another way would be to make this magic value a property and set it in the constructor of the derived class to 0. This will prevent the change.
Rafal source share