title: How to read from stdin in assembly
body: <p>This is my code:</p>
  
  <pre><code>#open
  mov $5,%eax
  mov $file,%ebx
  mov $0,%ecx
  int $0x80
  mov %eax,fd
  
  #read
  mov $3,%eax
  mov fd,%ebx
  mov $buff,%ecx
  mov $8,%edx
  int $0x80
  </code></pre>
  
  <p>it works, but I have to read the name of the file from the terminal.
  (I have to do something like: <code>$./myProgram fileToRead.txt</code>)
  How can I change my code? I try with:</p>
  
  <pre><code>mov $0,%ebx
  </code></pre>
  
  <p>but it doesn't work..</p>
  
  <pre><code>/usr/bin/ld:text.txt: file format not recognized; treating as linker script
  /usr/bin/ld:text.txt:1: syntax error
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Where am I wrong?</p>