title: syntax to compile 16 bit (8086code) in nasm
body: <p><strong>I'm confused how to compile 8086 code in nasm.<br>
  i used following command to assemble:</strong></p>
  <ul>
  <li><strong>nasm hello.asm -o hello.o</strong>   //;(Something wrong with this?)</li>
  </ul>
  <p><strong>This is 8086 Hello world code:</strong></p>
  <pre><code>USE16
  .model small
  
  .stack 100h
  .data
  msg db &quot;Hello World !$&quot;
  .code
  main proc near
  
      mov ax,@data
      mov ds,ax
  
      mov dx, offset msg
      mov ah, 09h
      int 21h
  
      mov ah,00
      int 21h
  
  endp
  end main
  </code></pre>
  <p><strong>And this is the output</strong></p>
  <p>nasm hello.asm -o hello.o<br>
  hello.asm:3: error: parser: instruction expected<br>
  hello.asm:4: error: parser: instruction expected<br>
  hello.asm:5: warning: label alone on a line without a colon might be in error [-w+label-orphan]<br>
  hello.asm:9: warning: label alone on a line without a colon might be in error [-w+label-orphan]<br>
  hello.asm:11: error: parser: instruction expected<br>
  hello.asm:16: error: comma, colon, decorator or end of line expected after operand<br>
  hello.asm:23: warning: label alone on a line without a colon might be in error [-w+label-orphan]<br>
  hello.asm:24: error: parser: instruction expected<br></p>