title: masm division overflow
body: <p>I'm trying divide two numbers in assembly. I'm working out of the Irvine assembly for intel computers book and I can't make division work for the life of me.</p>
  
  <p>Here's my code</p>
  
  <pre><code>.code
  main PROC
      call division
      exit
  main ENDP
  
  division PROC
      mov eax, 4
      mov ebx, 2
      div ebx
      call WriteDec
      ret
  divison ENDP
  
  END main
  </code></pre>
  
  <p>Where WriteDec should write whatever number is in the eax register (should be set to the quotient after the division call). Instead everytime I run it visual studio crashes (the program does compile however).</p>