Hi,
First sorry for my poor English. I've found not a few nice random number generators, but I have a problem how to initiate it.

There is several good eggs, but:

1. RDTSC instruction, as I think it's very good, but it may be not allowed in CPL 3.
2. IN Acc, DX (i.e. DX=40hex) instruction, as I think it's very good, but it may be not allowed in CPL 3.
3. CALL QueryPerformanceCounter/QueryPerformanceFrequency (WinAPI), but if the installed hardware does not support a high-resolution performance counter, the return value is zero.
4. CALL GetTickCount, as I think is not so good.

What do you think of it? How is your own solution?
:confused:
Posted on 2003-06-02 14:12:23 by MazeGen
I use GetTickCount and then I ROR/XOR/whatever the value some times. That's good enough for me :)
Posted on 2003-06-02 14:19:54 by Delight
Im ror-ing too, this one is fully enought for me ( best result is about 17 clicks) i attached and old prog of mine to test my random functions.


BTW. if u realy wont something POwerfull u should serch for "WhizKid Technomagic" random number generator, His stuff is realy awsome.
Posted on 2003-06-02 16:39:12 by AceEmbler
Hi

If you're looking for something a little more sophisticated you might want to try the Park-Miller or Mersenne Twister algorithms, both are discussed here:

http://www.asmcommunity.net/board/showthread.php?threadid=11188&highlight=random+number

For API's you could also try UuidCreate, which creates a unique 128 bit identifier which can be used as a seed or "random" value.

Cheers,
Kayaker
Posted on 2003-06-02 16:41:01 by Kayaker
Posted on 2003-06-03 04:00:39 by Vortex
Thanks to all - I got it.
Posted on 2003-06-04 15:27:34 by MazeGen