title: Segmentation fault while trying to write for loop in NASM on Linux
body: <p>I'm trying to write a simple NASM program for fun, but I can't seem to figure out how to write a for loop in it. With the following code, I get a segmentation fault. The following code is supposed to print out "Hello world!" followed by all of the numbers from one to 100.</p>
  
  <pre><code>section .data
      message: db 'Hello world!', 10
      messageLength: equ $-message
  
  section .text
      global _start
  
  _start:
      mov eax, 4
      mov ebx, 1
      mov ecx, message
      mov edx, messageLength
      int 80h
  
      mov ecx, 0
      jmp loop
  
      mov eax, 1
      mov ebx, 0
      int 80h
  
  loop:
      mov eax, 4
      mov ebx, 1
      mov edx, 1
      int 80h
  
      add ecx, 1
      cmp ecx, 100
      jl loop
  </code></pre>