title: Why is there no Z80 like LDIR functionality in C/C++/rtl?
body: <p>In Z80 machine code, a cheap technique to initialize a buffer to a fixed value, say all blanks.   So a chunk of code might look something like this.</p>
  
  <pre><code>LD HL, DESTINATION             ; point to the source
  LD DE, DESTINATION + 1         ; point to the destination
  LD BC, DESTINATION_SIZE - 1    ; copying this many bytes
  LD (HL), 0X20                  ; put a seed space in the first position
  LDIR                           ; move 1 to 2, 2 to 3...
  </code></pre>
  
  <p>The result being that the chunk of memory at DESTINATION is completely blank filled.
  I have experimented with memmove, and memcpy, and can't replicate this behavior.  I expected memmove to be able to do it correctly.</p>
  
  <p><strong>Why do memmove and memcpy behave this way?</strong></p>
  
  <p><strong>Is there any reasonable way to do this sort of array initialization?</strong></p>
  
  <p>I am already aware of char array[size] = {0} for array initialization</p>
  
  <p>I am already aware that memset will do the job for single characters.</p>
  
  <p>What other approaches are there to this issue?</p>