The MASM Forum

Miscellaneous => Miscellaneous Projects => Topic started by: HSE on October 22, 2024, 06:42:38 AM

Title: Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom...
Post by: HSE on October 22, 2024, 06:42:38 AM
Hi all!

A lot of interest into RNG this days  :thumbsup:

Here a translation from C to Assembly, using Masm64 SDK.

This use Randy Hyde loops macros (in SmplMath) just to make a more nice code :biggrin:

(I presume everybody changed vc__i64toa to vc__ui64toa en str$ macro.)

Regards, HSE.
Title: Re: Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom...
Post by: zedd151 on October 22, 2024, 06:54:06 AM
 :thumbsup:

:biggrin:
Title: Re: Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom...
Post by: NoCforMe on October 22, 2024, 10:43:20 AM
Any chance of porting that to 32-bit code for us Luddites here?
Title: Re: Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom...
Post by: HSE on October 22, 2024, 11:10:18 AM
Quote from: NoCforMe on October 22, 2024, 10:43:20 AMAny chance of porting that to 32-bit code for us Luddites here?

That could be a lot of work, you can do it  :biggrin:

I think there are several mersenne 32 bits algorithms in the forum. I mostly used RNG.inc, wich was in ObjAsm32 examples.

Note: Twister show why 64 bits is more powerful than 32 bits. And can be faster,just code become a little hard to follow  :biggrin:  :biggrin: