divide 64bit in two 32bit registers by 32bit <p>I am trying to write an x86 emulator in JavaScript for education purposes. I have already written a compiler and at the moment I am trying to write the x86 emulator in JavaScript.</p> <p>I have however a problem with the DIV instruction. According to <a href="http://siyobik.info/index.php?module=x86&amp;id=72" rel="nofollow">http://siyobik.info/index.php?module=x86&amp;id=72</a> DIV takes a 64bit number as input by interpreting EDX as the higher 32bit and EAX as the lower 32bit. It then divides this number by the DIV parameter and puts the result (if it is not greater than 0xFFFFFFFF) into EAX and the remainder into EDX.</p> <p>As JavaScript does not support 64bit integer I need to apply some tricks. But so far I did not come up with something useful.</p> <p>Does someone here have an idea how to implement that correctly with 32bit arithmetic?</p>