I looked at the RNG in TempleOS out of curiosity. I assumed he was mixing in some noise sources that could be explained as some kind of universal communication subchannel from god. Here's the relevant code (in HolyC of course):
There are very similar RNG functions for signed and unsigned versions of 16, 32 and 64 bit ints. The GetTSC function just calls RDTSC, combines the two 32-bit halves in EAX and EDX and returns the recombined 64-bit TSC.
So the last returned value is used as part of the seed for the next one. The initial seed is set in kend.cpp:
sys_rnd_seed =93186752^GetTSC;
I have to admit, I was a bit disappointed that god would be quite so deterministic.
So the last returned value is used as part of the seed for the next one. The initial seed is set in kend.cpp:
I have to admit, I was a bit disappointed that god would be quite so deterministic.