;Program: CPUTEST ;Version: 1.0 ;Author: Bruce Morgen ;Date: August 10, 1988 ;Derivation: A routine added to Z3LOC by the author (@ v1.2) ; (8080 test from Bob Freed via Steven Greenberg) ;Purpose: Identify the current system's CPU as belonging ; to one of the three extant CP/M-compatible ; families, Intel 8080/8085, Zilog Z80/National ; NSC800 or Hitachi HD64180/Zilog Z80180. ;Syntax: None to speak of, just invoke as usual. TPA EQU 0100H ; Normal CP/M transient area BDOS EQU 0005H ; Page 0 vector to DOS PRNSTR EQU 9 ; DOS print-string function # MLTBC EQU 4CEDH ; Two byte opcode, rvrsd. for DW CR EQU 0DH ; ASCII LF EQU 0AH ; " ORG TPA LD C,PRNSTR ; Print intro. string LD DE,STRCPU CALL BDOS SUB A ; Test for 8080ish CPU LD DE,STRI80 ; Point 8080ish string JP PE,DONE ; Print that if parity even set LD BC,0101H ; Put ones in B and C DW MLTBC ; Multiply to BC (Z80 ignores) LD DE,STR180 ; Point to HD64180ish string DJNZ DONE ; If B = 1 we're not a '180 ; Otherwise go say we are one LD DE,STRZ80 ; Point Z80ish string DONE: LD C,PRNSTR ; Load function number JP BDOS ; Print and exit via DOS STRCPU: DB CR,LF,'This CPU is a$' STRI80: DB 'n 8080 or 8085.',CR,LF,'$' STR180: DB 'n HD64180 or Z80180.',CR,LF,'$' STRZ80: DB ' Z80 or NSC800.',CR,LF,'$' END