NOT
on a register holding binary 11111111
will produce 00000000
, but ZF will still have its old value, so it might not be 1
even though the output value is all zero.
XOR reg, -1
would do the same thing but will set FLAGS according to the result.
Why does bitwise NOT don't affect the ZF bit? Hope someone can explain why, or it was originally designed like this.