section .text bits 32 ; ********************************************************* ; * ; * FLOAT RANDOM ; * ; * returns -32767.0f..32767.0f ins st(0) ; * ; ********************************************************* global _KZG_frand@0 _KZG_frand@0: pushad mov eax, dword [_KZG_frand_seed] mov edx, 31415621 inc eax mul edx mov dword [_KZG_frand_seed], eax and eax, 0xFFFF push eax fild word [esp] pop edx fmul dword [_KZG_frand_div] popad ret section .data _KZG_frand_div dd 3.0518509475997192297128208258309e-5 section .bss _KZG_frand_seed resd 1