title: Can I substitute a MOV operation with an OR operation?
body: <p>First of all, I'd like to say that I'm new to ASM and if this is a stupid question please excuse it.</p>
  <p>I read in <a href="https://www.agner.org/optimize/microarchitecture.pdf" rel="nofollow noreferrer">Agner Fog's microarchitecture manual</a> about partial register stalls (this seems a little bit advanced, but I was curious why 32-bit instructions in 64-bit mode zero the top half of the register). Example 6.13 gives a solution for how to avoid a register stall. I am a bit confused about this still, why was an OR operation not used instead of the MOV, like such:</p>
  <pre><code>xor eax, eax
  mov al, byte [mem8]
  ; or  al, byte [mem8] ; why not this?
  </code></pre>
  <p>I think the effect is the same. Do they both take the same amount of cycles per second? Is one more efficient than the other? Is there something &quot;under the hood&quot; that would make me prefer one over the other?</p>