title: Mixing c++ and assembly cant pass multiple paramaters from C++ function to assembly
body: <p>I've been frustrated by passing parameters from a c++ function to assembly. I couldn't find anything that helped on Google and would really like your help. I am using Visual Studio 2017 and masm to compile my assembly code. </p>
  
  <p>This is a simplified version of my c++ file where I call the assembly procedure <code>set_clock</code></p>
  
  <pre><code>int main()
  {
      TimeInfo localTime;
      char clock[4] = { 0,0,0,0 };
      set_clock(clock,&amp;localTime); 
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>I run into problems in the assembly file. I can't figure out why the second parameter passed to the function turns out huge. I was going off my textbook, which shows similar code with PROC followed by parameters. I don't know why the first parameter is passed successfully and the second one isn't. Can someone tell me the correct way to pass multiple parameters?</p>
  
  <pre><code>.code
  set_clock PROC, 
      array:qword,address:qword
      mov rdx,array   ; works fine memory address: 0x1052440000616
      mov rdi,address ; value of rdi is 14757395258967641292
      mov al, [rdx] 
      mov [rdi],al    ; ERROR: cant access that memory location
      ret
  set_clock ENDP
  END
  </code></pre>