Re: A83: TSE nearing completion
[Prev][Next][Index][Thread]
Re: A83: TSE nearing completion
Aren't you trashing the stack by _@RandomNumberSeed? _@RandomNumberSeed
is equated to -2 which is referenced as a data location which -2 =
$FFFE... so aren't you getting\putting the seed value at $FFFE
David Phillips wrote:
>
> If you need one to be absolutely as fast as possible, then this one that I
> wrote a while ago works out fairly well. It works by pulling "random" bytes
> out of the ROM. Not as nice as a table, but can't get away with that on the
> calc:
>
> ; a fast, yet decent random number generator
> ; returns: a = psuedo random number
> ; destroyed: flags
> RandomNumber:
> push bc
> ld a,r
> ld b,a
> ld a,($1234)
> _@RandomNumberSeed =$-2
> ld c,a
> ld a,(bc)
> ld (_@RandomNumberSeed),a
> xor b
> sub b
> add a,c
> pop bc
> ret
>
> > increment mode), yes? Can you be more specific about producing random
> numbers?
> > (please...)
--
Scott "_Wrath_" Dial
wrath@calc.org
ICQ#3608935
TimeCity AI Guy II - www.timecity.org
Member of TCPA - tcpa.calc.org
Follow-Ups:
References: