Assume the following example:
test %eax, %eax
jne Label
I know that the JNE assembly instruction does the same thing as the JNZ instruction. It takes the jump if the Zero Flag ZF is equal to 0. However, if we now assume that the value of %eax is 1, then after the first line the Zero Flag will be 0 and the jump will be taken, although %eax and %eax are obviously equal. This confuses me a lot because we take the jump not equal, although the two registers we compare are actually equal. Intuitively, this makes no sense to me as we should only take the jump if whatever we compare is not equal to each other. I hope someone could clarify why JNE works this way.