title: Calling C function in assembly code (gas)
body: <p>I found an example and was editing it for gas.</p>
  
  <pre><code>extern printf
  .global _start
  .data
  hello:
  db "Hello", 0xa, 0
  .text
  _start:
  mov %rdi, hello
  mov %rax, 0
  call printf
  mov %rax, 0
  ret
  </code></pre>
  
  <p>But it doesn't work. What's wrong? What does this mean:</p>
  
  <pre><code>    hello:
  db "Hello", 0xa, 0
  </code></pre>
  
  <p>I understand what it scope of memory, but I don't understand this string</p>
  
  <pre><code>db "Hello", 0xa, 0
  </code></pre>
  
  <p>And here</p>
  
  <pre><code>_start:
  mov %rdi, hello
  mov %rax, 0
  call printf
  mov %rax, 0
  ret
  </code></pre>
  
  <p>os: linux (debian). intel 64-bit</p>