This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
hotdog1234


Advanced Member


Joined: 14 Aug 2009
Posts: 291

Posted: 10 Sep 2009 10:38:05 am    Post subject:

I read the following about the R register: "R is the dynamic RAM refresh register, it increases after every instruction by an amount depending on the instruction. Its contents are pseudo random. You can only load to and from it using A."

Does R increase by the number of T-States per instruction, or how much does it increase depending on the instruction?
Back to top
Mapar007


Advanced Member


Joined: 04 Oct 2008
Posts: 365

Posted: 10 Sep 2009 10:45:10 am    Post subject:

It doesn't really matter. You basically just use it as a pseudo-random number generator.

Sigma's guide says: 'Bits 0 to 6 are incremented after each instruction is executed, bit 7 staying at whatever was loaded.'


Last edited by Guest on 10 Sep 2009 12:59:24 pm; edited 1 time in total
Back to top
DigiTan
Unregistered HyperCam 2


Super Elite (Last Title)


Joined: 10 Nov 2003
Posts: 4468

Posted: 10 Sep 2009 11:10:30 am    Post subject:

I think it's based on fetches and prefetches. You can test this by single-stepping through the emulator's debug mode.

Last edited by Guest on 10 Sep 2009 11:12:12 am; edited 1 time in total
Back to top
Seren


Newbie


Joined: 14 Aug 2009
Posts: 27

Posted: 10 Sep 2009 02:48:37 pm    Post subject:

I vaguely recall it being written somewhere that opcodes that are identified by 1 byte increment it by 1, while those that take 2 increment by 2. (not including the parameters)


Here we go:

http://www.absoluteastronomy.com/topics/Zilog_Z80
"The refresh register, R, increments each time the CPU fetches an opcode (or opcode prefix) and has therefore no simple relationship with program execution. This has sometimes been used to generate pseudorandom numbers in games, and also in software protection schemes. It has also been employed as a "hardware" counter in some designs; a famous example of this is the ZX81, which lets it keep track of character positions on the TV screen by triggering an interrupt at wrap around (by connecting INT to A6)."
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement