home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / sysutl / cputest.lbr / CPUTEST.ZZ0 / CPUTEST.Z80
Text File  |  1988-08-29  |  1KB  |  56 lines

  1. ;Program: CPUTEST
  2. ;Version: 1.0
  3. ;Author: Bruce Morgen
  4. ;Date: August 10, 1988
  5.  
  6. ;Derivation:    A routine added to Z3LOC by the author (@ v1.2)
  7. ;        (8080 test from Bob Freed via Steven Greenberg)
  8.  
  9. ;Purpose:    Identify the current system's CPU as belonging
  10. ;        to one of the three extant CP/M-compatible
  11. ;        families, Intel 8080/8085, Zilog Z80/National
  12. ;        NSC800 or Hitachi HD64180/Zilog Z80180.
  13.  
  14. ;Syntax:    None to speak of, just invoke as usual.
  15.  
  16.  
  17. TPA    EQU    0100H        ; Normal CP/M transient area
  18.  
  19. BDOS    EQU    0005H        ; Page 0 vector to DOS
  20. PRNSTR    EQU    9        ; DOS print-string function #
  21. MLTBC    EQU    4CEDH        ; Two byte opcode, rvrsd. for DW
  22.  
  23. CR    EQU    0DH        ; ASCII
  24. LF    EQU    0AH        ;   "
  25.  
  26.     ORG    TPA
  27.  
  28.     LD    C,PRNSTR    ; Print intro. string
  29.     LD    DE,STRCPU
  30.     CALL    BDOS
  31.     SUB    A        ; Test for 8080ish CPU
  32.     LD    DE,STRI80    ; Point 8080ish string
  33.     JP    PE,DONE        ; Print that if parity even set
  34.     LD    BC,0101H    ; Put ones in B and C
  35.     DW    MLTBC        ; Multiply to BC (Z80 ignores)
  36.     LD    DE,STR180    ; Point to HD64180ish string
  37.     DJNZ    DONE        ; If B = 1 we're not a '180
  38.                 ; Otherwise go say we are one
  39.     LD    DE,STRZ80    ; Point Z80ish string
  40. DONE:    LD    C,PRNSTR    ; Load function number
  41.     JP    BDOS        ; Print and exit via DOS
  42.  
  43. STRCPU:
  44.     DB    CR,LF,'This CPU is a$'
  45.  
  46. STRI80:
  47.     DB    'n 8080 or 8085.',CR,LF,'$'
  48.  
  49. STR180:
  50.     DB    'n HD64180 or Z80180.',CR,LF,'$'
  51.  
  52. STRZ80:
  53.     DB    ' Z80 or NSC800.',CR,LF,'$'
  54.  
  55.     END
  56.