title: x64 assembly, ret register and variables
body: <p>I'm relatively new to x64 assembly and im using it in conjunction with VS2010. 
  I'm struggling to get a handle on the return values from a proc and I can't really find quality documentation for beginners. </p>
  
  <pre><code>.data
   MyByte db 10
  
   .code
  GetValueFromASM proc
  mov rax, 28
  mov rbx , 19
  lea rax, MyByte
  mov rax, 10
  mov eax, 11
  mov ecx, 100
  
  ret
  GetValueFromASM endp
  end
  </code></pre>
  
  <p>The Ret instruction is printing out the value of eax in my c++ front end, is there some sort of default return register or can you specify it? </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  extern "C" int GetValueFromASM();
  
  int main()
  {
      cout &lt;&lt; "sup, asm said " &lt;&lt;GetValueFromASM()&lt;&lt;endl;
  
      cin.get();
      return 0;
  }
  </code></pre>
  
  <p>furthermore the instruction mov [reg], MyByte  yields an error, how else do you put a variable into a register? </p>