A86: Re: Re: Assembly-86 Digest V1 #869


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

A86: Re: Re: Assembly-86 Digest V1 #869




That's not entirely correct.  The R register is the memory refresh register.
It is used by the hardware to know when to refresh the dynamic memory (yes,
the calc's ram is just like the computer's ram in the fact that it must be
constantly refreshed...which is why they don't want to make all the ram in
new calc's ram...flash ram/rom doesn't drain the batteries to be refreshed).

The highest bit can be ignored, so it effectively counts from 0 to 127.
When the 8th bit is set, it is reset (I'm not sure of the exact
details...bit 7 may just be reset, or the whole thing, but anyway) and
memory is refreshed.  It is incremented after each instruction, just like
PC, by how many cycles (I think it's cycles and not t-states) the
instruction takes.  Actually, now that I think of it, it might be t-states.
Hmm.

But anyways, while it can be useful for psuedo random numbers, by itself, it
is a poor generator, as it tends to come up with many repeatable patterns.
Used in conjuction with a better algo (like the one I posted earlier), it
can be quite effective.  Matthew Shepcar had a very nice looking routine,
though it seemed like it'd be slow (lot's of repeated 16 bit additions).  R
is good for things like AI where speed is critical.


>
> don't you guys know that there is a random register called 'r' that is
only
> accessed through the 'a' register:
>     ld a,r
> 'r' is random because it is incremented every intsruction the processor
> executes.  you can just do that.  for example you needed a number 0-3
> randomly:
>     ld a,r
>     and %0000 0011
> quit wasting your time on a random number routine!
>
> jimi
>
>
>
> -----Original Message-----
> From: Assembly-86 Digest <owner-assembly-86@lists.ticalc.org>
> To: assembly-86-digest@lists.ticalc.org
> <assembly-86-digest@lists.ticalc.org>
> Date: Sunday, April 18, 1999 6:00 PM
> Subject: Assembly-86 Digest V1 #869
>
>
> >
> >Assembly-86 Digest       Monday, April 19 1999       Volume 01 : Number
869
> >
> >
> >
> >Index of topics in this issue:
> >
> >    Re: A86: Random Numbers II
> >
> >See the end of the mail for information about the list!
> >
> >----------------------------------------------------------------------
> >
> >Date: Sun, 18 Apr 1999 12:57:23 EDT
> >From: Nicolas P Zagorin <ziggy2282@juno.com>
> >Subject: Re: A86: Random Numbers II
> >
> >try the dice.asm source code...if basically does the exact thing ur
> >looking for only twice,so just double it.
> >
> >
> >~Nick
> >
> >___________________________________________________________________
> >You don't need to buy Internet access to use free Internet e-mail.
> >Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
> >or call Juno at (800) 654-JUNO [654-5866]
> >
> >------------------------------
> >
> >End of Assembly-86 Digest V1 #869
> >*********************************
> >
> >---------
> >To unsubscribe from assembly-86-digest, send a mail to
> "majordomo@lists.ticalc.org",
> >writing "unsubscribe assembly-86-digest" in the message body.
>
>
>
>
>



References: