0

`why 0x35014541 is output of xor eax, ebx? xor does not shows only 1 or 0?

**Register**
eax = 0xffffffff
ebx = 0xcafebabe

**Code**
    xor eax, ebx

Output

eax = 0x35014541

Expected

1

hstuk
  • 1
  • 1
    Can you explain how you got 1 as the expected answer? – harold Feb 23 '22 at 08:14
  • It's a bitwise xor, 32 separate boolean XOR gates in parallel, one for each bit, like the C `^` operator. No idea how `1` would make sense as an output even if you thought the output had to be 0 or 1; both the inputs are non-zero. Or did you think it was a horizontal xor of all the bits, like the parity flag is for the low 8 bits? Anyway, doesn't really matter what wrong idea you had, because that's not how it works. – Peter Cordes Feb 23 '22 at 08:41

0 Answers0