[comp.os.cpm] Z80 Emulator

roadhog@austex (Lindsay Haisley) (01/25/91)

Discussion on this newsgroup of Z80 emultors brings me to a question to
which I've been looking for an answer for some time.  Is there an MS-DOS
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
debugger which will allow me to work effectively on CCP, BDOS and ZCPR3 
system components.  The emulators I've seen so far (which isn't very many)
allow running plain vanilla CP/M programs under a simulated BDOS and, as
in the case of Z80MU, don't really support disk functions.  Joan Riff and 
company don't seem to understand that a CP/M disk is just a doubly sub-
scripted array from the point of view of the BIOS, and any managing 
software need only be able to import and optionally export "files" from 
this data structure to and from true files in the MS-DOS environment, a
fairly simple job.  The BDOS file handling system is much more complex, 
but there are enough copies of the CP/M BDOS, ZRDOS, NovaDOS, ZSDOS, 
etc. around to handle the job if BIOS emulation is properly done, and a 
boot routine is provided to load some system software into the emulated
64K Z80 memory domain.  Such a system would provide maximum flexibility
in CP/M emulation.  Riff seems to have the attitude that anything other
than plain vanilla CP/M (e.g. ZCPR3) or stock MS-DOS (e.g. 4DOS) is a sin
against nature and the users of same should take their computers and go
straight to the Warm Place.  On top of that, newer versions of Z80MU are
severely overpriced (considering that they don't do a true CP/M BIOS 
emulation) at $150, for which price I can buy Borland's Turbo C++
Professional or similar package with loads of disks, documentation, 
examples, etc....
 
                             Lindsay Haisley


"Everything works if you let it!"
 ---  Travis J. Redfish
 +++++++++++++++++++++++++++
uucp: austex!roadhog@emx.utexas.edu  OR  roadhog%austex.uucp@emx.utexas.edu
 BBS: (512) 259-1261 (Z-Node 77 - aka - Kaypro Club of Austin)

wilker@descartes.math.purdue.edu (Clarence Wilkerson) (01/25/91)

I don't want to get into the "RIFF" wars again. I think
Z80MU has a certain market that is happy to use it.
If you don't want the bells and whistles of the newer
versions, the last public domain version is still kicking
about.
   If you just want a RAW z80 emulation package that will
potentially run any z80 operating system, I haven't seen
any. Your best bet would be to get source to one of the
existing emulators, for example, the Heath User's group
emulator. 
   If speed is not an issue, there have been at least a
couple of emulators issued on usenet for z80's, written
in C. Complete z80 implementations may be hard to find,
because often people get tired of thinking about half parity
flags and DAA, etc.
Clarence Wilkerson

eichin@APOLLO.COM (Mark Eichin) (01/26/91)

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>