Re:Assembly Optimization Tips by Mark Larson
by 0xf00ff00f on Friday November 15, 2024 @06:38AM
(#42146009)
Also, x86 has an instruction that multiplies two 32-bit registers and stores the 64-bit result in two 32-bit registers. So you get the result of the division in the register with the high part of the multiplication result, and don't need to do a shift.
A longer tutorial that goes into more depth: https://homepage.cs.uiowa.edu/~jones/bcd/divide.html