title: How to populate a 64 bit register with duplicate byte values
body: <p>I'm doing some x64 assembly with Visual C++ 2010 and masm ('fast call' calling convention).</p>
  
  <p>So let's say I have a function in C++:</p>
  
  <pre><code>extern "C" void fillArray(unsigned char* byteArray, unsigned char value);
  </code></pre>
  
  <p>The pointer to array will be in RCX and char value will be in DL</p>
  
  <p>How can I fill RAX with values using DL such that if I were to <code>mov qword ptr [RCX], RAX</code> and print byteArray, all the values would be equal to 'char value'?</p>
  
  <p>Please note that I'm not trying to do out-code my compiler, I'm just learning.</p>