home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / cpm / 1628 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  2.0 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!ucbvax!LL.MIT.EDU!sage
  2. From: sage@LL.MIT.EDU (Jay Sage)
  3. Newsgroups: comp.os.cpm
  4. Subject: Re: 8080/8085/Z80 Code Identifier
  5. Message-ID: <9301241501.AA23431@LL.MIT.EDU>
  6. Date: 24 Jan 93 20:01:31 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 32
  11.  
  12. John Winslade asked about determining if a given COM file included Z80 or
  13. 8085 code in addition to 8080 code.  A few people offered answers.  One was
  14. the following:
  15.  
  16. >> There's a trick I SORTA remember which uses the Z80's additional overflow
  17. >> capability of the parity flag.
  18.  
  19.    This is not the answer to the question at hand.  It is a method of
  20. determining within a program what kind of processor it is actually running
  21. on at the time.  It is often used in programs that require a Z80 to make
  22. sure they are NOT running on just an 8080 so that they can abort gracefully
  23. before they go up in flames.
  24.  
  25.    In fact, as one reply noted, it would be extremely difficult to determine
  26. by any simple analysis what opcodes appear in a COM file, since there is no
  27. easy way to discriminate between code and data.  However, there is a rather
  28. nice way to find out if you have, of all things, a DOS machine with the
  29. 22NICE emulator.  If I remember correctly, it  can optionally be set up to
  30. emulate only 8080 opcodes or to emulate the full Z80 set.  In the former
  31. mode, it will trap Z80 opcodes as illegal.  This approach works because the
  32. emulator actually tries to execute the program, and that distinguishes
  33. between data and code.
  34.  
  35.    It would be possible to do the same thing under CP/M itself, namely, to
  36. write an 8080/Z80 emulator (strange to emulate a processor on the very
  37. processor that is being emulated!).  In fact, it may even be that the DSD
  38. (Dynamic Screen Debugger) tool already does this (it certainly could be made
  39. to do it), since it supports an emulation mode in which it does not actually
  40. run the code (as DDT and SID do) but emulates (simulates) its operation
  41. while allowing a user routine to evaluate whatever one wishes on each step
  42. of the code.
  43.  
  44.