<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 10 May 1983 0925-:00CDT
From   : John Otken <CC.Otken@utexas-20.arpa>
Subject: Subroutine to test for 8080 or Z80.

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
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>