title: Assembly program with unsigned/signed division
body: <p>I am trying write a simple Assembly program that divide 1000 by 5, but my program freezes the system.</p>
  
  <p>The program is as follows,</p>
  
  <pre><code>include pcmac.inc   
  .model Small
  .586
  
  .stack 100h
  
  .data
  const db 5
  
  Main PROC
      _Begin  
  
      mov AX, 1000  
      idiv const  // Problem line
  
      _Exit 0 
  Main ENDP
      End Main
  </code></pre>
  
  <p>The problem goes away if I use unsigned division <code>div</code> instead of signed division <code>idiv</code>.</p>
  
  <p>Can anyone explain why?</p>
  
  <p>The only condition I know for division is the dividend has to be double the size of divisor. Is there something else I am missing?</p>