Re: A83: Re: RandInt(


[Prev][Next][Index][Thread]

Re: A83: Re: RandInt(




registers can only contain integer values. The FP operators (OP1, OP2 etc.)
use decimal numbers (see the FP format in ASMGURU).

-----Oorspronkelijk bericht-----
Van: Anton Kuckartz <su025882@wolmail.nl>
Aan: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
Datum: vrijdag 22 september 2000 17:23
Onderwerp: RE: A83: Re: RandInt(


>
>Is this with decimals, or just a number without decimals?
>
>-----Oorspronkelijk bericht-----
>Van: owner-assembly-83@lists.ticalc.org
>[mailto:owner-assembly-83@lists.ticalc.org]Namens Frank Schoep
>Verzonden: woensdag 20 september 2000 18:44
>Aan: assembly-83@lists.ticalc.org
>Onderwerp: A83: Re: RandInt(
>
>
>
>Dunno if it's right, but it should work (slowly):
>
>; random number routine (returns de (0 to hl)
>; input : hl = maximal result
>; output: de = pseudo random number
>
>randnum:
>    push hl
>    call _random
>    pop hl
>    call _setxxxxop2
>    call _fpmult
>    call _convop1
>    ret
>
>Just paste this code somewhere in your project and use 'call randnum' to
>create a random number in DE with HL as maximal number. I thought Ion
>supported some routine, but I don't really wanna know.
>
>Greez,
>Frank
>
>
>
>