What is the meaning of XOR in x86 assembly?

前端 未结 11 1884
醉梦人生
醉梦人生 2020-12-13 08:50

I\'m getting into assembly and I keep running into xor, for example:

xor     ax, ax

Does it just clear the register\'s value?

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 09:38

    A XOR B in english would be translated as "are A and B not equal". So xor ax, ax will set ax to zero since ax is always equal to itself.

    A B | A XOR B
    0 0 | 0
    1 0 | 1
    0 1 | 1
    1 1 | 0
    

提交回复
热议问题