On Fri, Jan 02, 2009 at 10:09:36PM -0600, Jim Battle wrote:
Rodnay Zaks had a fat Z80 book that went into quite
some detail of the
timing of the bus and mentioned a hidden "W" register, but I don't recall
what that was for -- holding a byte temporarily during some do-si-do. I
have the book but it is buried in the garage.
The book is Programming The Z80, now sadly out of print but commonly
available second-hand. It's a very good book on assembler programming
in general as well as being an excellent Z80 reference - although note
that it ignores *all* the "undocumented" instructions. He also mentions
a hidden Z register, but never mentions what W and Z are used for.
In my emulator, I use W whenever doing things with (HL) and Z in the CP
and CPI instructions. In both cases I could have used a temporary
variable instead, but I chose early on to implement them as registers to
keep the internal API a bit more consistent if I found myself using
them.
Source code, for those who care:
http://drhyde.cvs.sourceforge.net/viewvc/drhyde/perlmodules/CPU-Emulator-Z8…
--
David Cantrell | Enforcer, South London Linguistic Massive
Perl: the only language that makes Welsh look acceptable