title: What is signed division(idiv) instruction?
body: <p>In intel instruction, idiv(integer divsion) means signed division.<br>
  I got the result of <code>idiv</code>, but I don't quite understand the result.<br>
  <br>
  <strong><em>- Example</em></strong>  </p>
  
  <pre><code>0xffff0000 idiv 0xffff1100
  </code></pre>
  
  <p><br>
  <strong><em>- My wrong prediction</em></strong><br>
  As long as I know, <code>quotient</code> should be 0, and <code>remainder</code> should be 0xffff0000 and because...  </p>
  
  <pre><code>0xffff0000 / 0xffff1100 = 0  
  0xffff0000 % 0xffff1100 = 0xffff0000  
  </code></pre>
  
  <p><br>
  <strong><em>- However, the result was...</em></strong><br>
  <em>Before <code>idiv</code></em>  </p>
  
  <pre><code>eax            0xffff0000            # dividend
  esi            0xffff1100            # divisor
  edx            0x0                     
  </code></pre>
  
  <p><em>After <code>idiv</code></em>  </p>
  
  <pre><code>eax            0xfffeedcc            # quotient
  edx            0x7400   29696        # remainder
  </code></pre>
  
  <p><br>
  <strong><em>- Question</em></strong>.<br>
  The result was value I couldn't expected.<br>
  Could someone explain about signed division(<code>idiv</code>)?</p>
  
  <p><br> 
  <strong><em>- Appended.</strong> 
  Here's More information about <code>idiv</code>.<br>
  <code>idiv</code> uses the eax register as a source register.<br>
    As a result of execution, quotient is stored at eax, and remainder is stored at edx.</em>  </p>