This is a satisfactory, though home-made 32-bit pseudo-randomizer. It churns integers but scales them to return floats -1.0 to +1.0. To return 32bit integer ranges, omit the float scaler and return the raw integer value in **eax** instead.

` int seed=0x12345678`

'

function Rnd() as float

=======================

Static As float f, d=1/0x7fffffff

mov eax,seed

inc eax

rol eax,13

xor eax,0xdab5ca3a

mov seed,eax

push eax

fild dword [esp]

pop eax

fmul dword d

fstp dword f

return f

end function

You are probably familiar with this one from the web, based on **mul** overflows into **edx**.

The 2 inputs are the lower and upper range limits:

` function irnd(int z1, z2) as int`

================================

mov eax,z2

sub eax,z1

inc eax

imul edx,Seed,0x8088405

inc edx

mov Seed,edx 'store new seed

mul edx 'multiply eax by edx

return edx+z1

end Function