;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 # DJNZ EQU 10H ; Opcode byte MLTBC EQU 4CEDH ; Two byte opcode, rvrsd. for DW CR EQU 0DH ; ASCII LF EQU 0AH ; " ORG TPA MVI C,PRNSTR ; Print intro. string LXI D,STRCPU CALL BDOS SUB A ; Test for 8080ish CPU LXI D,STRI80 ; Point 8080ish string JPE DONE ; Print that if parity even set LXI B,0101H ; Put ones in B and C DW MLTBC ; Multiply to BC (Z80 ignores) LXI D,STR180 ; Point to HD64180ish string DB DJNZ ; If B = 1 we're not a '180 DB DONE-$-1 ; Otherwise go say we are one LXI D,STRZ80 ; Point Z80ish string DONE: MVI C,PRNSTR ; Load function number JMP 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