From: utzoo!decvax!decwrl!sun!megatest!fortune!hpda!hplabs!sri-unix!CC.Otken@utexas-20.arpa Newsgroups: net.micro.cpm Title: Subroutine to test for 8080 or Z80. Article-I.D.: sri-arpa.1346 Posted: Tue May 10 07:25:00 1983 Received: Fri May 13 04:06:17 1983 From: John Otken Quite a few people seem to be writing Z80 only code these days which could be bad news to some 8080/8085 CPUs. Well, here is a subroutine which exploits the subtle differences in 8080s and Z80s. ;; Z80 - Test for Z80 CPU. ; ; exit: (Zf) = set if Z80 processor ; BC, DE, HL unchanged ; Z80 xra a ; Clear parity flag ori 80h adi 80h ; Clear zero, set parity if Z80 jpo Z801 ; if 8080/8085 xra a ; Set zero Z801 ret -------