title: Linux assembly and printf
body: <p>i try write simple assemble program with printf function. I compile it <code>nasm -f elf 64</code> and link using <code>gcc</code>. After run i see <code>segmentation fault</code>. What is wrong?</p>
  
  <pre><code>[Bits 32]
  
  extern printf
  global main
  
  section .data 
  
  hello:
  db "Hello", 0xa, 0 
  
  section .text
  
  main:
  
  push hello
  call [printf]
  
  add esp, 4
  
  mov eax, 1
  mov ebx, 0
  int 80h
  </code></pre>