title: Division of two numbers in NASM
body: <p>Starting to teach myself assembly (NASM) I wanted to know how to divide 2 numbers (For instance on Windows).</p>
  
  <p>My code looks like this but it crashes.</p>
  
  <pre><code>global _main
  extern _printf
  
  section .text
  
  _main:
  
  mov eax, 250
  mov ebx, 25
  div ebx
  push ebx
  push message 
  
  call _printf
  add esp , 8
  ret
  
  message db "Value is = %d", 10 , 0
  </code></pre>
  
  <p>I wonder what's really wrong? It doesn't even display the value after the division.</p>