title: Splitting NASM assembly source code into libraries
body: <p>I would like to split my nasm code into several files, so that I can work on different pieces of code separately. However, the only way I found is using nasm <code>%include</code> macro. For example. <code>main.asm</code> file looks somewhat like this,</p>
  
  <pre><code>; ---- main.asm ----
  %include "./header.asm"
  
  section .text
      global _start
  _start:
  
      call dummy_func
  
      mov rax, 0x3c
      mov rdx, 0x0
      syscall
  </code></pre>
  
  <p>while <code>header.asm</code> only contains</p>
  
  <pre><code>section .text
  dummy_func:
          ret
  </code></pre>
  
  <p>I have heard about a way to do this during linking. I got very interested in that, but couldn't find anything appropriate. Is it really possible? If so, can it be done with <code>ld</code>? What other means are there to include a static library? (probably some more macros. However I'm not sure "macros" is the right word here)</p>