BTW, in case it wasn't clear in the original example, XOR will toggle the flag - if you want to explicitly remove it you should either check that it is already set, or mask it and use AND instead.