title: NASM Assembly 16bit "invalid combination of opcode and operands"
body: <p>So I'm trying to write a program that creates a file and  my name in it.
  But I get the "invalid combination of opcode and operands" on 
  the <code>mov handle, ax</code>, and I don't know why. 
  I saw <a href="https://stackoverflow.com/questions/29569269/writing-a-string-to-a-file-100-times-in-assembly">here</a> that you can do it so why can't I.
  Thank you in advance for any help.</p>
  
  <pre><code>org 100h
  
  mov ah, 3ch     ;create a file
  mov dx, name    ;file name
  mov cx, 0       
  int 21h
  
  mov handle, ax ; save handle
  
  mov ah, 40h     ;write to file
  mov bx, handle
  mov cx, 1000    
  mov dx, text    ; what to write
  int 21h
  
  mov ah, 3eh     ;close the file
  mov bx, handle
  int 21h
  
  
  mov ax, 4C00h ; end 
  int 21h
  
  section .data
  name db "name.txt", 0
  text db "Michal",0ah,0dh,"$"
  
  section .bss
  handle resb 2
  </code></pre>