title: XOR all bytes in 64 bit register in fewer instructions
body: <p>Assume on some x86-64 platform we have some 64-bit value stored in some 64-bit register (let it be the <em>RAX</em>). The challange is to <em>XOR</em> all bytes of initial value in fewer instruction calls (it doesn't matter where to store result). Here is my 8-instruction solution (in NASM):</p>
  
  <pre><code>mov    rbx, rax
  bswap  rbx
  xor    eax, ebx
  mov    ebx, eax
  bswap  ebx
  xor    ax, bx
  mov    bx, ax
  xor    al, bh
  </code></pre>
  
  <p>I'm not very experienced in ASM programming, so maybe you guys have some better solution in term of instructions amount.
  Thanks!</p>