Re: A86: Re: question
[Prev][Next][Index][Thread]
Re: A86: Re: question
At 02:14 1998-03-08 -0500, you wrote:
>
>a nice way to get random numbers that ppl can't tamper with, and that doesn't
>require the OP registers is the 'r' register (which i believe is what
ztetris,
>or at least one of the zshell versions, if not jimmy mardell's, uses)...
>something like this is good:
> ld a,r
> shr a
>
>the shr a is necessary b/c the r register increases by 2 each clock cycle, so
>the right bit is always the same. now a is a 7 bit random #... if you need
>less bits, then shift it right some more... also, you can't really use that
>method again until you do something that requires some sort of user input
>because it will always be so much above the original, anyway, i'm
babbling, so
>i'll stop now... hope this helps.
Are you sure about that? I checked the R register once, and IIRC, it's
bit 7 that's always cleared, not bit 0 (which I though at first). And
the R register is, iirc, increased with 1, except that bit 7 is always 0.
--
Real name: Jimmy Mårdell
IRC......: Yarin
Email....: mailto:yarin@acc.umu.se <-- NEW E-MAIL ADDRESS!!!!
Homepage.: http://www.algonet.se/~mja/
Follow-Ups:
References: