title: How does the internal implementation of memcpy work?
body: <p>How does the standard C function 'memcpy' work? It has to copy a (large) chunk of RAM to another area in the RAM. Since I know you cannot move straight from RAM to RAM in assembly (with the mov instruction) so I am guessing it uses a CPU register as the intermediate memory when copying?</p>
  
  <p>But how does it copy? By blocks (how would it copy by blocks?), by individual bytes (char) or the largest data type they have (copy in long long double's - which is 12 bytes on my system).</p>
  
  <p>EDIT: <strong>Ok apparently you can move data from RAM to RAM directly</strong>, I am not an assembly expert and all I have learnt about assembly is from this document (<a href="http://www.cs.virginia.edu/~evans/cs216/guides/x86.html">X86 assembly guide</a>) which mentions in the section about the mov instruction that you cannot move from RAM to RAM. Apparently this isn't true.</p>