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 / CPM / 6502 / 6502SIM.LBR / ZX65SIM.DQC / ZX65SIM.DOC
Text File  |  2000-06-30  |  4KB  |  83 lines

  1.                 ZX65SIM
  2.  
  3. This file documents the updates made to the 6502 simulator
  4. for CP/M developed by R.M Kruse, and released to the public
  5. in an article published by Doctor Dobb's Joural, August, 1981
  6. issue.
  7.  
  8. ---------------
  9.  
  10.    As distributed, ZX65 was difficult to "bring up", due to
  11. its hard-wired linkages to the CP/M BIOS, along with the customized
  12. loader modification necessary to relocate the package to high mem-
  13. ory.  Also, the simulator contained a relatively large amount of
  14. code to provide a built-in DOS, to allow the page-zero CP/M area
  15. to be overwritten by the 6502 code being simulated (restricting the
  16. use of page 0  extracts a cost in efficiency, since the 6502 has such
  17. "cheap" page-zero addressing modes).
  18.  
  19.    It occured to me that the memory limitations could be circumvented
  20. by remapping all 6502 memory references into Z80 memory.  This required
  21. major modification of the simulator (basically, I had to find all of the
  22. code that addressed 6502 memory, and change these to external subroutine
  23. calls), as well as a new module (ZX65HOST.MAC) that could be linked in
  24. with the simulator.  This new module may be rewritten for different users
  25. that may have different needs (in fact, I have three locally for hardware
  26. development I'm doing).  The distributed version simply remaps 6502
  27. references into the free space above the program (using the L80 $MEMRY
  28. variable to locate the free area); the initialization entry point is
  29. used to load a binary file (see the source file for syntax); this could
  30. be modified, however, to provide such things as hardware initialization
  31. for, say, a hardware in-circuit-emulator to be used in conjunction with
  32. the simulator program.
  33.  
  34.    I also added a crude "traceback" feature, that displays the last n
  35. pc's executed ('n' is specified via an equate in ZX65SIM.MAC); these are
  36. stored in a circular buffer within the simulator, and accessible via the
  37. 'H' command.
  38.  
  39.    I removed the built-in DOS, since binary files may now be loaded via
  40. the initialization subroutine within ZX65HOST.  I know that this circumvents
  41. the author's original SAVE FILE command, but I never really saw a need for
  42. such a command.  Perhaps someone will add it back in using the CP/M BDOS...
  43.  
  44.    Finally, I modified the simulator to assemble using Microsoft's M80/
  45. L80 combination (instead of the obscure SDS assembler formerly used).  Since
  46. not everyone is likely to have this wonderful set of software tools, I've
  47. included the linked object code in the distribution set.  To reassamble and
  48. link, use the following sequences:
  49.  
  50.         M80 =ZX65SIM         (to assemble the main module)
  51.         M80 =ZX65HOST         (to assemble the remapper)
  52.         L80 ZX65SIM,ZX65HOST,ZX65HOST /N/E
  53.                      (to link the two, and produce
  54.                       ZX65SIM.COM)
  55.  
  56.    I should note that the 6502 fetch and store routines within ZX65HOST
  57. must NOT modify any registers (of course, FETCHA must return the fetched
  58. byte in the accumulator).  AINIT (the initialization routine) may modify all.
  59.  
  60.    Here is a breakdown of the files included with the package:
  61.  
  62.     ZX65SIM.COM    -- the assembled and linked object code
  63.     ZX65SIM.MAC    -- source for the simulator
  64.     ZX65HOST.MAC    -- source for the remapper
  65.     ZX65SIM.DOC    -- the file you're reading
  66.     ZXART.DOC    -- the DDH article as originally published in DDJ
  67.     ZXTABLES.DOC    -- tables that were published with the article
  68.     ZX65HINTS.DOC    -- original author's post-publication comments
  69.  
  70.    Note that none of the original documention has been modified; therefore
  71. you should be aware that some of it may be inapplicable in this new release
  72. (such as those files that reference the built-in DOS).
  73.  
  74.    If you have any questions regarding this package (at least insofar as
  75. concern the changes that I've made), I may be reached via the FORT FONE FILE
  76. FOLDER, an RCPM system located in Fort Atkinson, Wisconsin (phone number:
  77. (414) 563-9932).
  78.  
  79.             Happy simulations!
  80.  
  81.             Ron Fowler
  82.             Dec 17, 1982
  83.