@PaniczGodek because char, unsigned char and signed char are integer types.
A char can contain a value from -128 up to 127. 0x80 is 128 so when you set 0x80 to a char variable it's going to overflow. That's why your if fails because you are comparing if your char is 128 and it's not.
If you use an unsigned char which can hold values from 0 to 255 then your if is going to work as expected.