title: Segmentation fault in Assembly and string
body: <p>I am trying to make a simple program in assembler, but I do not understand why, I get a fault.
  I' ve a 64 bit machine running Ubuntu 12.04, and "as" as a assembly compiler.
  My goal merely is to print the string "Hello" on screen.</p>
  
  <p>I wrote this:</p>
  
  <pre><code>#print.s
  .section .data
  .globl StringToPrint
  
   StringToPrint: .asciz "Hello"
  
   .globl _start
  
    _start:       
      movq $4, %rax
      movq $1, %rbx
      movq $StringToPrint, %rcx
      movq $5, %rdx
      int $0x80
   _done:    
      ret
  </code></pre>
  
  <p>But that's what I get:</p>
  
  <pre><code>$ as print.s -o print.o
  $ ld print.o -o print
  $ ./print
  Hello[1]    10679 segmentation fault (core dumped)  ./print
  </code></pre>
  
  <p>Why do you think this happens? Any idea?</p>