title: How do I pass arguments to C++ functions when I call them from inline assembly
body: <p>So, I would like to be able to call functions from a c++ dll.
  For certain reasons, I would like to call them from an __asm block in my C++ code.
  My question is this: I know that before I call the function, I have to push its arguments on the stack in the order specified by the function's calling convention.However, can i simply do something like this:</p>
  
  <pre><code>int a=5;   
  double b = 5.0;  
  __asm{  
         push b 
         push a  
         call functionAddress  
  }
  </code></pre>
  
  <p>What worries me is the fact that I seem to remember that the standard word size in assembly is 2bytes, while the size of an int in C++ is usually 4bytes, and 8 bytes for a double.So , in the example above, am I really pushing the full value of each variable, or just the first couple of bytes? If the code above is not correct, what would be the right way to do it? Also, if the function we are calling returns a double, where is this value stored? I'm assuming it can't be in a register, because it can only store 32bits ( 4bytes ).Any help with this mess would be greatly appreciated :)</p>