title: How to call a C function from Assembly?
body: <p>Here's the entire assembly program:</p>
  
  <pre><code>.model small
  .stack 256
  
  .code
  start:
      call printer
      mov ax, 3       ; store 3 into ax
  
      mov ah, 76      ; back to DOS
      mov al, 0       ; no errors
      int 21h         ; interupt -&gt; DOS
  end start
  </code></pre>
  
  <p>And this is where I define the <code>C</code> function <code>printer</code></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void printer()
  {
      printf("Hello!\n");
  }
  </code></pre>
  
  <p>When compiling the assembly code, I get an error: <code>undefined symbol: printer</code>. In <code>C</code> I would do an <code>#include "file.h"</code>, how do I achieve the same result here?</p>