Re: A82: R and I 8-bit registers


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

Re: A82: R and I 8-bit registers



At 09:41 AM 8/17/97 -0600, you wrote:
>How can I, or can I use the R and I registers? (R=memory refresh, 
>I=interrupt) And can I use the PC register (Program Pounter)??

Over the past 24 hrs you have been VERY active on this list.  I am
beginning to wonder what you are up to exactly.  However, here are the
answers to your questions.

The R register is mainly used as a random variable.  Don't EVER store a
value into it (don't think you could, even if you wanted to).  However, its
not truly random (see TUNNEL.82P for an example).  It shifts back and forth
between several values.  If you want a real good randomizer, use a table,
this register, and a little ingenuity.

The I register is to NEVER be touched unless you know what you are doing.
GreyScale graphics routines use this register which points to the 257 bytes
of RAM which then points to the GreyScale routine itself.

As for the PC (Program Counter) register, you can't directly access it.
You can, however, use the stack as a way to edit it.  The PC register is
the pointer in the CPU which tells where in RAM/ROM to read the next
instruction.  Only CALL and RET edit the PC register.  Again, don't mess
with this unless you know what you are doing.

Hope I could be of help.  Happy programming!


                 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


References: