;RND

#include "func\f32\mov4.z80"
;#include "func\f32\randinit.z80"

;HL is value tra parentesi
;BC point to float32 to save rand

func_rand:

;zero
ld a,h
or l
jr z,func_rand_ret_last

;positivo
bit 7,h
jr z,func_rand_2

;negativo
res 7,h
ld (seed0),hl
ld (seed0+2),hl
ld (seed1),hl
ld (seed1+2),hl

call f32rand

func_rand_2:
call f32rand

func_rand_save_last:
;push bc
ld h,b
ld l,c
ld de,lastrand
call mov4
;pop bc
ret

func_rand_ret_last:
ld hl,lastrand
ld d,b
ld e,c
jp mov4
