title: Making assembly function inline in x64 Visual Studio
body: <p>I know that MSVC compiler in x64 mode does not support inline assembly snippets of code, and in order to use assembly code you have to define your function in some external my_asm_funcs.asm file like that:</p>
  
  <pre><code>my_asm_func PROC
      mov rax, rcx
      ret
  my_asm_func ENDP
  </code></pre>
  
  <p>And then in your .c or .h file you define a header for the function like that:</p>
  
  <pre><code>int my_asm_func(int x);
  </code></pre>
  
  <p>Although that solution answers many concerns, but I am still interested in making that assembly code function to be inline, in other words - after compilation I don't want any "calls" to <strong>my_asm_func</strong>, I just want this piece of assembly to be glued into my final compiled code. I tried declaring the function with <em>inline</em> and <em>__forceinline</em> keywords, but nothing seems to be helping. Is there still any way to do what I want?</p>