ifndef                  _MISC_ASM
_MISC_ASM               equ     1

; ------------------------------------------------------
; Name: Get_Random_Number()
; Desc: Return a random number between two boundaries
Get_Random_Number       proc    LowerBound:real4, Upperbound:real4
                        call    rand
                        push    eax
                        fild    dword ptr [esp]
                        fdiv    CFLT(32767.0)
                        fld     Upperbound
                        fsub    LowerBound
                        fmulp   st(1),st(0)
                        fadd    LowerBound
                        fstp    dword ptr [esp]
                        pop     eax
                        ret
Get_Random_Number       endp

; ------------------------------------------------------
; Name: Init_Random_Seed()
; Desc: Init the random numbers generator
Init_Random_Seed        proc    Seed:real4
                        push    Seed
                        call    srand
                        ret
Init_Random_Seed        endp

endif