I keep getting \'Program received signal SIGFPE, Arithmetic exception\' when dividing in x86 Assembly. It\'s confusing because the answer should be smaller than a 64 bit ans
You'll need to do this division similar to long hand division by hand. Put the dividend in another pair of registers or memory. Then clear edx and load eax with the high order dividend. Then divide edx:eax by the 32 bit divisor, and store eax (quotient) back into high order dividend. Next load eax with low order dividend (leaving edx alone), and divide by the 32 bit divisor again. Store eax back into low order dividend. After this, high and low order dividend = dividend/divisor (a 64 bit quotient), and edx = dividend % divisor (32 bit remainder).