title: Assembly: copy contents of string into another register
body: <p>I'm having trouble figuring out how to copy the contents of one string into another. Here's what I'm working with: Given an address of a string in a register <code>rbx</code>, I need to copy the contents of that address of a string into another register(argument 4) <code>rdx</code>. </p>
  
  <p>Here's what I'm currently doing</p>
  
  <pre><code>mov rbx, qword[rsi+16] ; rbx = some string address
  ; performs checks on string
  ; etc..
  ; string passes tests so
  mov rbx, qword[rbx]
  mov qword[rdx], rbx
  </code></pre>
  
  <p>the problem is that <code>qword</code> will only allow me to store <strong>8</strong> characters into rdx, while the actual maximum is 80(just an arbitrary maximum I defined in the start of my program). I could of course change <code>qword</code> to <code>dqword</code> but this doesn't sovle my problem as it would go from 8 character to 16. If I pass the string <code>Arguments</code> into the function above I would be returned <code>Argument</code>, since the copy assignment only handles 8 characters.</p>
  
  <p>I apologize in advance as this is probably a really simple solution, but I'm very new to assembly. How can I move the contents of one string to another? </p>