title: How to open a file in assembler and modify it?
body: <p>I'm starting to learn Assembler and I'm working in Unix. I want to open a file and write   'Hello world' on it.</p>
  
  <pre><code>section .data
  
  textoutput db 'Hello world!', 10
  lentext equ $ - textoutput
  filetoopen db 'hi.txt'
  
  section .text
  global _start
  
  _start:
  
  mov eax, 5            ;open
  mov ebx, filetoopen
  mov ecx, 2            ;read and write mode
  int 80h
  
  mov eax, 4
  mov ebx, filetoopen   ;I'm not sure what do i have to put here, what is the "file descriptor"?
  mov ecx, textoutput
  mov edx, lentext
  
  mov eax, 1
  mov ebx, 0
  int 80h              ; finish without errors
  </code></pre>
  
  <p>But when I compile it, it doesn't do anything. What am I doing wrong?
  When I open a file where does the file descriptor value return to?</p>