<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 23 Jan 1993 22:17:12 GMT
From   : agate!spool.mu.edu!howland.reston.ans.net!usc!sol.ctr.columbia.edu!news.unomaha.edu!cwis!winslade@ucbvax.Berkeley.EDU (John Winslade)
Subject: Re: 8080/8085/Z80 Code Identifier

alpha@waggen.twuug.com (Joe Wright) writes:

>: Not that it'd be hard to write, but does anybody have some code you
>: can feed a random .COM file to and have it tell you whether or not it's
>: pure 8080, 8085, or Z80 code ?

>I don't suppose so.  You can run the target code through a disassembler
>and see what you get.  If you are sure you are in code and see JR to
>a reasonable address, it's Z80 code.  If you see only JP (JMP) instructions
>is is probably 8080 code.  8085 is identical to 8080 code except for
>the SIM/RIM instructions (8085).  Most CP/M applications are written
>in 8080 code so as to function equally well on 8080/8085/Z80 cpu's.

There's a trick I SORTA remember which uses the Z80's additional overflow
capability of the parity flag.  I can't remember the specifics, but 
trying this on an 8080/8085 and a Z80 will yield different results.
 
 MVI A,80H
 SUI 81H        ;; force an overflow
 JPO WHATEVER

If I remember correctly, the parity flag will be set on one and clear on
the other, but I cannot remember offhand which one it is.
 
Good day       JSW

<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>