home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / sysutl / cputest.lbr / CPUTEST.AZM / CPUTEST.ASM
Assembly Source File  |  1988-08-29  |  2KB  |  57 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. DJNZ    EQU    10H        ; Opcode byte
  22. MLTBC    EQU    4CEDH        ; Two byte opcode, rvrsd. for DW
  23.  
  24. CR    EQU    0DH        ; ASCII
  25. LF    EQU    0AH        ;   "
  26.  
  27.     ORG    TPA
  28.  
  29.     MVI    C,PRNSTR    ; Print intro. string
  30.     LXI    D,STRCPU
  31.     CALL    BDOS
  32.     SUB    A        ; Test for 8080ish CPU
  33.     LXI    D,STRI80    ; Point 8080ish string
  34.     JPE    DONE        ; Print that if parity even set
  35.     LXI    B,0101H        ; Put ones in B and C
  36.     DW    MLTBC        ; Multiply to BC (Z80 ignores)
  37.     LXI    D,STR180    ; Point to HD64180ish string
  38.     DB    DJNZ        ; If B = 1 we're not a '180
  39.     DB    DONE-$-1    ; Otherwise go say we are one
  40.     LXI    D,STRZ80    ; Point Z80ish string
  41. DONE:    MVI    C,PRNSTR    ; Load function number
  42.     JMP    BDOS        ; Print and exit via DOS
  43.  
  44. STRCPU:
  45.     DB    CR,LF,'This CPU is a$'
  46.  
  47. STRI80:
  48.     DB    'n 8080 or 8085.',CR,LF,'$'
  49.  
  50. STR180:
  51.     DB    'n HD64180 or Z80180.',CR,LF,'$'
  52.  
  53. STRZ80:
  54.     DB    ' Z80 or NSC800.',CR,LF,'$'
  55.  
  56.     END
  57.