title: How to pass functions parameters in a register with gcc asm keyword
body: <p>In gcc you can declare that a local variable should be put in a register using the following syntax.</p>
  
  <pre><code>register int arg asm("eax");
  </code></pre>
  
  <p>In some old code I found on the internet this syntax was used to declare that the parameters to a function should be passed in a register:</p>
  
  <pre><code>void foo(register int arg asm("eax"))
  </code></pre>
  
  <p>But when I try this example:</p>
  
  <pre><code>/*
     Program to demonstrate usage of asm keyword to allocate register for a variable.
  */
  #include &lt;stdio.h&gt;
  
  /* Function with argument passed in register */
  void foo(register int arg asm("eax") )
  {
      register int loc asm("ebx");
      loc = arg;
      printf("foo() local var: %d\n", loc);
  }
  
  int main(void)
  {
      foo(42);
      return 0;
  }
  </code></pre>
  
  <p>And compile with gcc I get an error:</p>
  
  <pre><code>gcc main.c -o test-asm.exe
  main.c:7:27: error: expected ';', ',' or ')' before 'asm'
  </code></pre>
  
  <p>Now my questions are:<br>
  Is the asm syntax above correct, in gcc that is, for formal parameters of a function?<br>
  Has this ever been supported by gcc?<br>
  If this is not the correct syntax, how can this be accomplished then?<br>
  <br>
  Thanks,<br>
  //jk</p>