Re: A82: The 'r' register zone


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

Re: A82: The 'r' register zone



At 08:38 PM 11/15/97 -0600, you wrote:
>The 'r' register is a random number generator.  It contains a value that 
>is a power of 2. So to use it to produce simple random numbers (as seen 
>in Avalanche) do this:
>
>ld a,r  ;get rand #
>srl a  ;shift right logically - to just 'change' the number a bit
>and 63 ;mask off bits so the # is between 1-63 - (e.g. and 127,3,15)
>
>Hope this helps!

Speaking of Avalanche...Game Wizard v2.0 works perfectly with it.  Great
job to whoever ported Avalanche for the 82!


                 Thomas J. Hruska -- thruska@tir.com
Shining Light Productions -- "Meeting the needs of fellow programmers"
         http://www.geocities.com/SiliconValley/Heights/8504
                    http://shinelight.home.ml.org


Follow-Ups: References: