home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / cpm / 1626 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.5 KB  |  38 lines

  1. Newsgroups: comp.os.cpm
  2. Path: sparky!uunet!usc!sol.ctr.columbia.edu!news.unomaha.edu!cwis!winslade
  3. From: winslade@cwis.unomaha.edu (John Winslade)
  4. Subject: Re: 8080/8085/Z80 Code Identifier
  5. Message-ID: <winslade.727827432@cwis>
  6. Sender: news@news.unomaha.edu (UNO Network News Server)
  7. Organization: University of Nebraska at Omaha
  8. References: <2411@sousa.tay.dec.com> <1993Jan23.000635.1843@waggen.twuug.com>
  9. Date: Sat, 23 Jan 1993 22:17:12 GMT
  10. Lines: 26
  11.  
  12. alpha@waggen.twuug.com (Joe Wright) writes:
  13.  
  14. >: Not that it'd be hard to write, but does anybody have some code you
  15. >: can feed a random .COM file to and have it tell you whether or not it's
  16. >: pure 8080, 8085, or Z80 code ?
  17.  
  18. >I don't suppose so.  You can run the target code through a disassembler
  19. >and see what you get.  If you are sure you are in code and see JR to
  20. >a reasonable address, it's Z80 code.  If you see only JP (JMP) instructions
  21. >is is probably 8080 code.  8085 is identical to 8080 code except for
  22. >the SIM/RIM instructions (8085).  Most CP/M applications are written
  23. >in 8080 code so as to function equally well on 8080/8085/Z80 cpu's.
  24.  
  25. There's a trick I SORTA remember which uses the Z80's additional overflow
  26. capability of the parity flag.  I can't remember the specifics, but 
  27. trying this on an 8080/8085 and a Z80 will yield different results.
  28.  
  29.  MVI A,80H
  30.  SUI 81H        ;; force an overflow
  31.  JPO WHATEVER
  32.  
  33. If I remember correctly, the parity flag will be set on one and clear on
  34. the other, but I cannot remember offhand which one it is.
  35.  
  36. Good day       JSW
  37.  
  38.