
sys seed

Function Rnd(sys z1,z2) as sys 
    pushad
    sys  rand 
    mov  eax,z2
    sub  eax,z1
    inc  eax
    imul edx,seed,0x8088405
    inc  edx
    mov  seed,edx
    mul  edx
    add  edx,z1
    mov  rand,edx
    popad
    Return rand
End Function 


function rand(sys z1,z2) as sys
mov eax,z2
sub eax,z1
inc eax
imul edx,seed,0x8088405
inc edx
mov seed,edx
mul edx
add edx,z1
return edx
end function


function brnd(sys z1,z2) as sys
seed*=0x8088405+1
eax=z2-z1+1 : mul seed
return edx+z1
end function


seed=12345 : print rnd  1,10 '4
seed=12345 : print rand 1,100 '39
seed=12345 : print brnd 1,1000 '386



