BITWISE XOR will TOGGLE a bit, not erase it (in other words, if it's not already set, it will set it, otherwise it will erase it).
As Sebholl said, you need to use BITWISE AND NOT (in BlitzMax "& ~")
As Sebholl said, you need to use BITWISE AND NOT (in BlitzMax "& ~")