title: Segmentation fault movsb nasm in 64 bits linux
body: <p>I'm new in asm, and trying to use some opcodes for getting my hands on it.
  I'm working on linux, 64 bits, and have allways a segmentation fault when using movsb. I compile with nasm:</p>
  
  <pre><code>nasm -f elf64 test.asm
  </code></pre>
  
  <p>Here is the code</p>
  
  <pre><code>DEFAULT ABS
  segment data
      data:
      texte: db 'Hello, World !!', 10, 13
      len: equ $-texte
      texteBis: db 'Hello, World !.', 10, 13
  
  segment code
      global main
  
  main:
      ;The problem is here
      mov rsi, texteBis
      mov rdi, texte
      mov cx, len
      rep movsb
  
      mov dx, len
      mov rcx, texte
      mov bx, 1
      mov ax, 4
  
      int 0x80
  
      mov bx,0        ; exit code, 0=normal
      mov ax,1        ; exit command to kernel
      int 0x80        ; interrupt 80 hex, call kernel
  </code></pre>
  
  <p>Other question, with string (or other large db instance), should I use </p>
  
  <pre><code>mov rsi, texte
  </code></pre>
  
  <p>or</p>
  
  <pre><code>mov rsi, [texte] 
  </code></pre>
  
  <p>I didn't understand which one gives the value and which one the address.</p>