If statement - checking only the first 5 MSB's.

No, only the temporary value in the register gets changed. The only way to change the value of the variable is an actual assignment: =, +=, -=, et al.

Really, this is programming 101.