hopcode, heres a rand i coded a long time ago for testing sorting algos.
mov esi, offset buffer ;buffer for rand output
mov edi, 500000d ;size in bytes
mov ebx, 49282048h ;seed
add edi, esi
xor ecx, ecx
@@:
rdtsc
rol eax, 5
lea eax,[eax*8+eax]
shr eax, 3
ror edx, 3
lea edx,[edx*8+edx]
rol edx, 7
or eax, edx
add eax, esi
add cl, al
ror cl, 3
rol eax, cl
xor cl, al
add cl, ah
rol eax, cl
lea eax, [eax*4+eax]
xor eax, ebx
mov cl, bh
mov ch, bl
ror cx, cl
rol ax, cl
ror eax, 15
lea eax, [eax*8+eax]
and ecx, ebx
ror eax, cl
mov [esi], eax
rdtsc
mov ebx, eax
lea ebx, [ebx*8+ebx]
lea ecx, [ecx*4+ecx]
rol ebx, cl
lea ebx, [ebx*4+ebx]
ror cx, cl
ror ebx, cl
add esi, 4
cmp edi, esi
jl @B
1gb of data generated by this rand, tested with ent:
Entropy = 8.000000 bits per byte.
Optimum compression would reduce the size
of this 1073741824 byte file by 0 percent.
Chi square distribution for 1073741824 samples is 268.19, and randomly
would exceed this value 50.00 percent of the times.
Arithmetic mean value of data bytes is 127.4989 (127.5 = random).
Monte Carlo value for Pi is 3.141590272 (error 0.00 percent).
Serial correlation coefficient is 0.000092 (totally uncorrelated = 0.0).
its fairly late but ill chime in on this some more tomorrow.