home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2073 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  2.0 KB

  1. From: darcy@druid.uucp (D'Arcy J.M. Cain)
  2. Newsgroups: alt.sources
  3. Subject: Re: Z80emulator
  4. Message-ID: <1990Nov15.163900.8326@druid.uucp>
  5. Date: 15 Nov 90 16:39:00 GMT
  6.  
  7. In article <274059c8.5f66@uop.uop.edu> nsayer@uop.edu (Nick Sayer) writes:
  8. > [...]
  9. >No, you need to make a CPM file with the CPM bdos, CCP and bios. I
  10. >can't distribute those. Digital Research's lawyer can beat up my lawyer. :-)
  11. >
  12. While my CP/M emulator isn't completely finished I am going to post it for
  13. people to play with if they wish.  If anyone wants to hack on it feel free
  14. to send back the fixes and I will include them.  I have taken what I think
  15. is an interesting direction is this version to emulate the CP/M stuff.  I
  16. do all the prompting and some specific commands such as SAVE, DIR etc myself
  17. which gives me a lot of speed for those commands.  For the BIOS and BDOS I
  18. don't have any Z80 code.  Instead I define the BDOS as starting at 0xfec0
  19. and the BIOS at 0xff00.  The decoder treats any instruction above 0xfec0 as
  20. if it was a RET.  The code that calls the decoder checks for that address
  21. and emulates the BDOS or BIOS call at that point.  The neat thing is that
  22. since the code is completely ignored you can have a TPA of 64K less the
  23. 256 bytes in page zero as long as the space above 0xfec0 is only used for
  24. data or stack.  In fact the default stack at startup is 0xfff0.
  25.  
  26. Of course it is slow even though I decode *every* instruction through a
  27. massive switch statement.  I have a few speedup ideas which depend on using
  28. the capabilities of the host processor but this would change from CPU to
  29. CPU.
  30.  
  31. There is a compile time option to make a debugging version which is even
  32. slower but is really useful for debugging the emulator as well as ordinary
  33. CP/M programs.  This isn't complete but is working to some extent.
  34.  
  35. Anyway watch alt.sources.  I'll post it shortly.
  36.  
  37. -- 
  38. D'Arcy J.M. Cain (darcy@druid)     |
  39. D'Arcy Cain Consulting             |   I support gun control.
  40. West Hill, Ontario, Canada         |   Let's start with the government!
  41. + 416 281 6094                     |
  42.