home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / EMULATOR / UNIX / CAIN2 / 00README.TXT < prev    next >
Text File  |  2000-06-30  |  3KB  |  61 lines

  1. CP/U - Control Program for Unix-like systems
  2. Written by D'Arcy J.M. Cain
  3. UUCP: darcy@druid
  4.  
  5. This is a quick overview of my CP/M emulator for Unix.  I apologize if
  6. it isn't completely up to date as the program is still evolving.
  7.  
  8. The system decodes most of the Z80 instruction set.  Mostly the I/O is
  9. not implemented.  Whenever the PC is >= 0xfec0 it executes a return no
  10. matter what is in RAM at that location.  Before calling the routine for
  11. each instruction I look at the PC and end the program if it is zero or
  12. perform a BDOS function if it is 0xfec0 or BIOS if it is >= 0xff00.  Since
  13. the emulator ignores the contents of memory as far as instruction decoding
  14. is concerned, The system has the interesting property of being able to use
  15. all of memory except the first 0x100 bytes for user programs by putting the
  16. stack at 0xfffe.  In fact the default stack when a program is run is set
  17. to 0xfff0.
  18.  
  19. I use Unix commands to simulate some CP/M commands such as DIR, REN, TYPE
  20. and handle things such as SAVE internally.  I use the Unix file system for
  21. drives.  The user defines Unix directories to CP/M drive mappings.  This
  22. allows CP/M to use the same file system.  Only lower case names are useable
  23. however and of course most CP/M programs will expect 8.3 style names.  If
  24. a CP/M filename ends in a period it is stripped.
  25.  
  26. The ED command translates to a call to whatever environment variable EDITOR
  27. points to.
  28.  
  29. There is a '!' command to do Unix commands from within CP/U.
  30.  
  31. Programs that use IN and OUT opcodes will fail.  All I/O must go through
  32. the BDOS or the BIOS.  The user can set up the following devices:  Screen
  33. (CON out), keyboard (CON in), RDR, PUN and LST.  The default for screen
  34. and keyboard is stdout and stdin.  The user can set up Unix files for any
  35. of these devices.  The file of course can be an actual file, a device or even
  36. a pipe to a command, even another CP/M command that has the keyboard reading
  37. from the same pipe.
  38.  
  39. Mostly I tried for speed except where speedup would depend on the program
  40. running on a specific processor.  The main part of the decoding module is
  41. a 256 entry switch table with sub-switches for the Z80 extensions.
  42.  
  43. There are two extra programs built from the sources for testing purposes.
  44. tcpm simply runs some code giving debug output.  This is for gross testing
  45. of things like byte order etc.  The other program is dcpm and this allows
  46. debugging of real CP/M programs.  A separate program is created for this
  47. purpose to prevent code bloat in the real run time.
  48.  
  49. It's not quite finished yet but I am running simple programs with it now.
  50. What would be nice would be some sort of test suite.  Anyone know of any?
  51. There is the start of a test suite included.
  52.  
  53. As for copyright, if you use it say where you got it and send me any fixes
  54. or enhancements if you feel like it.  It's free and you get what you pay
  55. for.  Don't blame me if it breaks anything or doesn't do what you expect.
  56. (In case it isn't obvious I am not a lia^H^Hawyer.)
  57.  
  58. D'Arcy J.M. Cain
  59. UUCP: darcy@druid
  60.  
  61.