home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / z3util / array10b.lbr / ARRAY3.ZZ0 / ARRAY3.Z80
Encoding:
Text File  |  1993-06-07  |  2.9 KB  |  102 lines

  1. ;Library Name: ARRAYLIB
  2. ;Module Name: ASKDSK
  3. ;Author: Al Hawley
  4. ;Date: 20 Mar 1987
  5. ;Version number: 1.0b
  6. ;Previous version: 1.0 dated 4 March 1987
  7.  
  8. ;Version History:
  9. ;1.0b    Corrected a bug which left the stack unbalanced on
  10. ;    an error exit.
  11.     
  12. ;Program Function: ARRAYLIB is a collection of subroutines which
  13. ;    implement the management of byte arrays in programs written
  14. ;    for Z80 or HD64180 based computers.
  15. ;    relocatable object library in the same manner as SYSLIB.
  16.  
  17. ;***************************************************
  18. ;        COPYRIGHT NOTICE
  19. ;ARRAYLIB is copyright by A. E. Hawley on March 4, 1987.
  20. ;It may be freely distributed, but it must not be sold 
  21. ;either separately or as part of a package without the 
  22. ;written consent of the author.  The author may be reached 
  23. ;via electronic mail at the Ladera Z-Node in Los Angeles,
  24. ;213-670-9465, or by U.S. Mail at:
  25. ;
  26. ;    6032 Chariton Ave.
  27. ;    Los Angeles, CA. 90056
  28. ;    Voice Phone: 213-649-3575
  29. ;
  30. ;        RELEASE NOTICE
  31. ;ARRAYLIB is released for beta test through the Z-system 
  32. ;users group Z-SIG.  It may be reached through the 
  33. ;Lillipute Z-Node in Chicago, 312-649-1730.
  34.  
  35. ;***************************************************
  36.  
  37.     name askdsk
  38. ;This module contains the following routines:
  39.     public artstdsk
  40. ;..and uses the following external routines:
  41.     ext arrxltrc
  42.  
  43. artstdsk:
  44. ;test the bytes in the row corresponding to the
  45. ;disk number in reg b to see if it is all nulls,
  46. ;meaning that the disk is not accessible.
  47. ;on entry,
  48. ;    b    = disk number to test
  49. ;on normal exit,
  50. ;if row is    all nulls    non-empty
  51. ;    a   =    0        0ffh
  52. ;    flgs    z,nc        nz,nc
  53. ;    e   =    0        0ffh
  54. ;registers preserved: d, hl, bc
  55. ;error exit:
  56. ;    a    = 1  means ARRAYDEF was never called
  57. ;    a    = 2  means row number is out of range
  58. ; carry flag is set to indicate the error condition
  59.  
  60.     push    hl
  61.     push    bc
  62.     dec    b        ;convert disk(1..16) to row(0..15)
  63.     ld    c,0        ;-> column 0
  64.     call    arrxltrc    ;convert to abs. address
  65.     jr    c,xtstdsk    ;ret if b > highest row or no array defined
  66.     ld    a,(hicol)    ;get highest column number
  67.     ld    b,a
  68.     inc    b        ;change to number of cols
  69.                 ;(= number of bytes to test)
  70.     xor    a        ;initialize accumulator
  71. tstrw1:    or    a,(hl)
  72.     inc    hl
  73.     djnz    tstrw1
  74.  
  75.     ld    e,0ffh
  76.     ld    a,e
  77.     jr    nz,xtstdsk    ;exit point - non empty row
  78.     inc    e        ;here on row full of nulls
  79.     ld    a,e
  80. xtstdsk:            ;common exit from this routine
  81.     pop    bc
  82.     pop    hl
  83.     ret
  84.  
  85. ;**********************************************
  86.     COMMON /ARDAT/
  87.  
  88. ;COMMON data area - contains default values for a 64
  89. ;byte array useful for disk/user bitmapping.
  90. bitmap:    dw    0    ;..filled in by ARRAYDEF
  91. hicol:    dw    3    ;4 columns: 0,1,2,3
  92. hirow:    dw    15    ;16 rows (0....15)
  93. dumaplen:
  94.     dw    64    ;(3+1)*(15+1)
  95.  
  96. maxdu:    dw    0    ;transient d/u data
  97. curloc:    dw    0    ;NDR entry pointer
  98.  
  99. ;**********************************************
  100.  
  101.     end
  102.