title: How to write new line in file in assembly
body: <p>I use Windows 8.1 and an emulator for assembly 8086.</p>
  
  <p>I wrote the assembly code below to write 2 messages in file, but it's not correct because it doesn't write newline between two messages.</p>
  
  <blockquote>
    <p>output : Masoud  Hosseini</p>
  </blockquote>
  
  <pre><code>data segment
  
      fname  DW  "c:\test.txt"
      len    DW  8   
      handel DW  ?
      endl   DB  13
      msg1   DB  "Masoud  "
      msg2   DB  "Hosseini"
  
  ends
  
  code segment
  start:
  
      mov ax, data
      mov ds, ax
      mov es, ax
  
      mov ah, 3ch  ;open file
      lea dx, fname
      int 21h
  
      mov handel, ax    ;save handel
  
      lea dx, msg1
      mov bx, handel
      mov cx, len
      mov ah, 40h
      int 21h
  
      lea dx, endl
      mov bx, handel
      mov cx, 1 
      mov ah, 40h
      int 21h
  
      lea dx, msg2
      mov bx, handel
      mov cx, len
      mov ah, 40h
      int 21h
  
      mov ax, 4c00h
      int 21h    
  ends
  
  end start
  </code></pre>