title: GCC Assembly Inline: Function Body with Only Inlined Assembly Code
body: <p>I am trying to reuse some assembly code in my C project. Suppose I have a sequence of instructions, and I would like to organize them as a function:</p>
  
  <pre><code>void foo() {
    __asm__ (
     "mov %eax, %ebx"
     "push %eax"
     ...
     );
  }
  </code></pre>
  
  <p>However, one obstacle is that in the compiled assembly code of function <code>foo</code>, besides the inlined assembly code, compiler would also generate some prologue instructions for this function, and the whole assembly program would become something like:</p>
  
  <pre><code>foo:
     push %ebp          &lt;---- routine code generated by compilers
     mov  %ebp, %esp    &lt;---- routine code generated by compilers
     mov %eax, %ebx
     push %eax
  </code></pre>
  
  <p>Given my usage scenario, such routine code actually breaks the original semantics of the inlined assembly. </p>
  
  <p>So here is my question, is there any way that I can prevent compiler from generating those function prologue and epilogue instructions, and only include the inlined assembly code?</p>