The MASM Forum

General => The Laboratory => Topic started by: Biterider on March 10, 2024, 07:07:09 PM

Title: MulDiv64 and OWORD procs
Post by: Biterider on March 10, 2024, 07:07:09 PM
Hi
Looking into the asm files from NT5Src (https://masm32.com/board/index.php?topic=11765.0) I found the assembler implementation of lldiv and llmul as well as MulDiv. 
Checking the actual implementation in Win10 I found that it has changed completely and it uses similar code as found in lldiv and llmul.

I took the sources and adapted them to create sqwordDiv and sqwordMul.
The second step was to extend the 32 bit code to 64 bit. This allowed sowordDiv and sowordMul to be created with full 128 bit precision.
The last step was quite simple, building MulDiv64 which uses the last 2 procedures.
Note that Window, curiously, does not provide this procedure natively.

Attached are all sources  :biggrin:

Biterider
Title: Re: MulDiv64 and OWORD procs
Post by: jj2007 on March 10, 2024, 09:49:48 PM
Well done :thumbsup:

I see you have both 32- and 64-bit code in the source. What about a little iMath32.lib and iMath64.lib?