title: NASM: segmentation fault(core dumped)
body: <p>I'm new to assembly and I've been trying to learn through random problems. Im using nasm 64 bit on a linux machine. I've been trying to generate the fibonacci sequence. However I get a segmentation fault(core dumped) error when I run my executable.</p>
  
  <pre><code>section .data
  
      input db 2
  
  section .bss
  
      fib resb 128
  
  section .text
  
  _start:
  
      mov rax, 1
      mov rcx, 1
      mov rdx, fib
      mov rdx, 1
      inc rdx
      mov rbx, 0
  
      call _fibLoop
      call _fibPrint
  
      mov rax, 60
      mov rdi, 0
      syscall
  
  _fibLoop:
  
      mov [rdx], rax
      inc rdx
      add rcx, rax
      push rcx
      mov rcx, [rax]
      pop rax
      inc rbx
      cmp rbx, [input]
      jne _fibLoop
      ret
  </code></pre>
  
  <p>I know the call to _fibPrint is not the issue cause it does virtually nothing. I assume the way I am writing to my reserved memory is flawed. However Ive been able to do this similarly in the past so I'm lost on whats wrong.</p>