home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / A-R / ERR11.LBR / ERR.ZZ0 / ERR.Z80
Text File  |  2000-06-30  |  3KB  |  187 lines

  1. ;PROGRAM TO GIVE SOFT ERROR COUNT SINCE LAST COLD BOOT ON
  2. ;HEATH/ZENITH H37 AND H17 DRIVES RUNNING UNDER CPM 2.2.02,
  3. ;2.2.03 AND 2.2.04 FOR H/Z 89/90
  4. ;
  5. ;Original author--unknown
  6. ;Changed to Z80 code and modified to run under NZCOM--Biff Bueffel--11/88
  7. ;
  8. false    equ    0
  9. true    equ    not false
  10. ;****************************************************************************
  11. ;*********SET NZCOM AND DRIVE EQUATES APPROPRIATELY BEFORE ASSEMBLY**********
  12. ;****************************************************************************
  13. NZCOM    equ    true    ;only needs to be false if using hard coded ZCPR3   *
  14. NZBIO    equ    900H    ;size of nzcom virtual bios                *
  15. H17    equ    true    ;set to true if using H17 drives            *
  16. H37    equ    true    ;set to true if using H37 drives            *    
  17. VERMSG    equ    true    ;print CPM version message                *
  18. ;****************************************************************************
  19. tpa    equ    100H        ;start of program area
  20. ;
  21. cr    equ    0DH
  22. lf    equ    0aH
  23. conout    equ    2
  24. pstring    equ    9
  25. bdos    equ    5
  26. ;
  27. z3env    equ    0fe00h        ;for debugging purposes only
  28. ;
  29.     org    tpa
  30.     jp    start
  31.     db    'Z3ENV'
  32.     db    1        ;type 1 enviroment
  33. z3eadr    dw    z3env        ;Z3ENV address
  34. ;
  35.     db    'nzcom->'
  36. nzcomt:    db    nzcom
  37.     db    'nzbio->'
  38. nzbioz:    dw    nzbio
  39.     db    'h17->'
  40. h17t:    db    h17
  41.     db    'h37->'
  42. h37t:    db    h37
  43.     db    'vermsg->'
  44. vmsgt:    db    vermsg
  45. ;
  46. start:    ld    hl,0
  47.     add    hl,sp
  48.     ld    sp,stack
  49.     push    hl
  50.     ld    de,crlf
  51.     ld    c,pstring
  52.     call    bdos
  53.     ld    hl,(1)
  54.     call    nzb
  55.     ld    de,33h-3
  56.     add    hl,de
  57.     ld    a,(hl)
  58.     ld    (vers),a
  59. ;
  60.     ld    a,(vmsgt)    ;get vermsg indicator
  61.     cp    0        ;see if false
  62.     jr    z,h17a        ;if so skip this
  63.     ld    de,msgver    ;prints cpm version message
  64.     ld    c,pstring
  65.     call    bdos
  66.     ld    a,(vers)
  67.     add    '0'
  68.     ld    e,a
  69.     ld    c,conout
  70.     call    bdos
  71.     ld    de,crlf
  72.     ld    c,pstring
  73.     call    bdos
  74. ;
  75. h17a:    ld    a,(h17t)
  76.     cp    0
  77.     jr    z,h37a
  78.     ld    a,(vers)
  79.     cp    2
  80.     jr    z,vers2
  81.     cp    3
  82.     jr    z,vers3
  83. vers4:    ld    hl,(1)
  84.     call    nzb
  85.     ld    de,4dh-3
  86.     jr    pr17
  87. vers3:    ld    hl,(1)
  88.     call    nzb
  89.     ld    de,49h-3
  90.     jr    pr17
  91. vers2:    ld    hl,(1)
  92.     call    nzb
  93.      ld    de,4ch-3
  94. pr17:    add    hl,de
  95.     ld    e,(hl)
  96.     inc    hl
  97.     ld    d,(hl)
  98.     ex    de,hl
  99.     call    decout
  100.     ld    de,msg1
  101.     ld    c,pstring
  102.     call    bdos
  103. ;    
  104. h37a:    ld    a,(h37t)
  105.     cp    0
  106.     jr    z,exit
  107. ;
  108.     ld    a,(vers)
  109.     cp    2
  110.     jr    z,exit
  111.     cp    3
  112.     jr    z,ver3
  113. ver4:    ld    hl,(1)
  114.     call    nzb
  115.     ld    de,4Fh-3
  116.     jr    pr37
  117. ver3:    ld    hl,(1)
  118.     call    nzb
  119.     ld    de,4bh-3
  120. pr37:    add    hl,de
  121.     ld    e,(hl)
  122.     inc    hl
  123.     ld    d,(hl)
  124.     ex    de,hl
  125.     call    decout
  126.     ld    de,msg2
  127.     ld    c,pstring
  128.     call    bdos
  129. ;
  130. ;
  131. ;
  132. exit:
  133.     pop    hl
  134.     ld    sp,hl
  135.     ret
  136. ;
  137. nzb:                ;Routine to get "real" warm boot vector in real bios
  138.     ld    a,(nzcomt)    ;see if nzcom configuration
  139.     cp    0        ;if not nzcom then return
  140.     ret    z
  141.     ld    a,(tpa+10)    ;get z3env default high byte into register a
  142.     cp    0feh        ;z3env high byte value
  143.     ret    z        ;if not nzcom is standard cpm
  144.     ld    de,nzbio    ;offset from nzcom bios to real bios
  145.     add    hl,de        ;add to nzcom warm boot vector
  146.     ret
  147. ;
  148. decout:    push    bc
  149.     push    de
  150.     push    hl
  151.     ld    bc,-10
  152.     ld    de,-1
  153. dx:    add    hl,bc
  154.     inc    de
  155.     jr    c,dx
  156.     ld    bc,10
  157.     add    hl,bc
  158.     ex    de,hl
  159.     ld    a,h
  160.     or    l
  161.     call    nz,decout
  162.     ld    a,e
  163.     add    '0'
  164.     ld    e,a
  165.     ld    c,conout
  166.     call    bdos
  167.     pop    hl
  168.     pop    de
  169.     pop    bc
  170.     ret
  171. ;
  172. vers    db    0
  173.  
  174. ;
  175. msgver:    db    'CP/M Version 2.2.0','$'
  176. ;
  177. msg1:    db    ' H17 Soft Disk Errors',cr,lf,'$'
  178. ;
  179. msg2:   db    ' H37 Soft Disk Errors',cr,lf
  180. ;
  181.     db    'since last Cold Boot.',cr,lf,'$'
  182. crlf:    db    cr,lf,'$'
  183. ;
  184.     ds    64
  185. stack    ds    0
  186.     end    start
  187.