title: How does the `asm()` function works in C language?
body: <p>I am learning Operating System Development and a Beginner of course. I would like to build my system in real mode environment which is a 16  bit environment using C language.</p>
  
  <p>In C, I used a function <code>asm()</code> to convert the codes to 16 bit as follows:</p>
  
  <pre><code>asm(".code16")
  </code></pre>
  
  <p>which in GCC's language to generate 16 bit executables(not exactly though).</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Suppose I have two header files <code>head1.h</code> and <code>head2.h</code> and a <code>main.c</code> file. The contents of <code>main.c</code> file are as follows:</p>
  
  <pre><code>asm(".code16");
  #include&lt;head1.h&gt;
  #include&lt;head2.h&gt;
  int main(){
    return 0;
  }
  </code></pre>
  
  <p>Now, Since I started my code with the command to generate 16 bit executable file and then included <code>head1.h</code> and <code>head2.h</code>, will I need to do the same in all header files that I am to create? (or) Is it sufficient to add the line <code>asm(".code16");</code> once?</p>
  
  <p>OS: Ubuntu</p>
  
  <p>Compiler: Gnu CC</p>