title: ASM x86 integer overflow
body: <pre><code>GetLCM PROC
  tryAgain:
     mov bx, 0
     inc Multiple
     mov ax, UserInputNum1              ;Move UserInputNum1 to the 16 bit Register
     mov bx, Multiple
     div bx                             ;&lt;-------Error here
     cmp dx,0                           ;If dx is not zero then there is a remainder
     jne tryAgain                       ;If not equal jump
  ret
  GetLCM ENDP
  </code></pre>
  
  <p>I keep getting a integer overflow error when trying to div these two numbers. It breaks when i try to use div.</p>
  
  <p>I am trying to find the least common multiple of two numbers entered by the user. I decided to try to divide each number to find prime numbers first then compare each time one is found to the other number the user entered. Of course I would be doing both numbers at the same time, but as of now I am trying to just get past this error.</p>
  
  <p>This is only my fifth week in ASM so I am a little confuse why this is happening.
  Also I would like to add that I would also like to make this work for 32bit numbers as well. My idea is to use pointers. Is this a good way to do this?
  Thanks for any help!</p>