title: Why should EDX be 0 before using the DIV instruction?
body: <p>I noticed when EDX contains some random default value like 00401000, and I then use a DIV instruction like this:</p>
  
  <pre><code>mov eax,10
  mov ebx,5
  div ebx
  </code></pre>
  
  <p>it causes an INTEGER OVERFLOW ERROR. However, if I set <code>edx</code> to 0 and do the same thing it works. I believed that using <code>div</code> would result in the quotient overwriting <code>eax</code> and the remainder overwriting <code>edx</code>.  </p>
  
  <p>Getting this INTEGER OVERFLOW ERROR really confuses me.</p>