Date : Fri, 25 Jan 1991 16:48:15 EST
From : Mark Eichin <eichin@apollo.com>
Subject: Z80 Emulator
From Lindsay Haisley <roadhog%austex.uucp@emx.utexas.edu>:
>>based Z80 emulator out there which does a >>full<< emulation of the CP/M
>>BIOS, including disk functions. I'm looking for an emulator with a monitor
Nick Sayer's emulator (posted to alt.sources a while ago, and
written in reasonably portable (at least among larger machines) C)
*only* fakes the BIOS (there's a table of BIOS entry points that does
RST 38H for each, which is detected by the emulator - the emulator
looks at the address, and does the appropriate BIOS function.) The
BDOS is loaded in from an external file, but is a normal Z80 (or 8080)
BDOS.
The problem with this design is that it is *SLOW*. There are a
number of places where the BDOS copies sectors around - that loop is
emulated instruction by instruction, which takes a long time.
From Clarence Wilkerson <wilker@descartes.math.purdue.edu>:
>> If you just want a RAW z80 emulation package that will
>>potentially run any z80 operating system, I haven't seen
Nick's emulator can certainly run anything with a BIOS; in
fact, if you disable the BIOS hooks and provide routines that do "the
right thing" with IN and OUT you can probably emulate *any* z80...
once I've got the time, I do intend to emulate the Radio Shack Model 4
(since I run TurboDOS on it - though I may try to get TRSDOS/LDOS up
just for laughs...)
>>in C. Complete z80 implementations may be hard to find,
>>because often people get tired of thinking about half parity
>>flags and DAA, etc.
Nick's emulation is *very* careful, particularly due to my
banging on it as an alpha tester... I also double checked everything
against the Zilog Z80 manual for clarification of what the flags do.
Half carry is done "live" as are all the flags (there is an "F"
register, and everything tweaks it as it goes...) There isn't really
any support for the different IM 0..2 interrupt modes, but I suspect
that doesn't matter much for most uses - and that code would tend to
need customization based on the particular hardware being emulated
anyhow.
_Mark_ <eichin@apollo.com>
<eichin@athena.mit.edu>
<z80-emulator-request@sipb.mit.edu>