title: Calling C functions from x86 assembly language
body: <p>Is it possible to generate assembly language functions from C functions using GCC, so that they can be invoked from an assembly language program? I know that gcc compiles C to machine code (which can easily be disassembled into assembly language), and I already know that it's possible to <a href="https://stackoverflow.com/questions/5131568/using-inline-assembly-in-c-c">inline assembly language functions in C</a>, but I haven't yet found a way to invoke C functions from assembly language programs, which is basically the inverse of this.</p>
  
  <p>Here, I'm attempting to inline a C function in an x86 assembly program. If inlining isn't possible, then is there some other way to invoke a C function from an assembly language program?</p>
  
  <pre><code>.686p
  .model flat,stdcall
  .stack 2048
  
  .data
  
  .code
  start:
  
  invoke  ExitProcess, 0
  
  printSomething PROC ;now I'm attempting to inline a C function here
      void printSomething(thingToPrint){
          printf("This is a C function that I want to invoke from an assembly language program.");
          printf("There must be some way to do this - is it possible somehow?");
      }
  printSomething ENDP
  
  end start
  </code></pre>