home *** CD-ROM | disk | FTP | other *** search
- ;Library Name: ARRAYLIB
- ;Module Name: ASKDSK
- ;Author: Al Hawley
- ;Date: 20 Mar 1987
- ;Version number: 1.0b
- ;Previous version: 1.0 dated 4 March 1987
-
- ;Version History:
- ;1.0b Corrected a bug which left the stack unbalanced on
- ; an error exit.
-
- ;Program Function: ARRAYLIB is a collection of subroutines which
- ; implement the management of byte arrays in programs written
- ; for Z80 or HD64180 based computers.
- ; relocatable object library in the same manner as SYSLIB.
-
- ;***************************************************
- ; COPYRIGHT NOTICE
- ;ARRAYLIB is copyright by A. E. Hawley on March 4, 1987.
- ;It may be freely distributed, but it must not be sold
- ;either separately or as part of a package without the
- ;written consent of the author. The author may be reached
- ;via electronic mail at the Ladera Z-Node in Los Angeles,
- ;213-670-9465, or by U.S. Mail at:
- ;
- ; 6032 Chariton Ave.
- ; Los Angeles, CA. 90056
- ; Voice Phone: 213-649-3575
- ;
- ; RELEASE NOTICE
- ;ARRAYLIB is released for beta test through the Z-system
- ;users group Z-SIG. It may be reached through the
- ;Lillipute Z-Node in Chicago, 312-649-1730.
-
- ;***************************************************
-
- name askdsk
- ;This module contains the following routines:
- public artstdsk
- ;..and uses the following external routines:
- ext arrxltrc
-
- artstdsk:
- ;test the bytes in the row corresponding to the
- ;disk number in reg b to see if it is all nulls,
- ;meaning that the disk is not accessible.
- ;on entry,
- ; b = disk number to test
- ;on normal exit,
- ;if row is all nulls non-empty
- ; a = 0 0ffh
- ; flgs z,nc nz,nc
- ; e = 0 0ffh
- ;registers preserved: d, hl, bc
- ;error exit:
- ; a = 1 means ARRAYDEF was never called
- ; a = 2 means row number is out of range
- ; carry flag is set to indicate the error condition
-
- push hl
- push bc
- dec b ;convert disk(1..16) to row(0..15)
- ld c,0 ;-> column 0
- call arrxltrc ;convert to abs. address
- jr c,xtstdsk ;ret if b > highest row or no array defined
- ld a,(hicol) ;get highest column number
- ld b,a
- inc b ;change to number of cols
- ;(= number of bytes to test)
- xor a ;initialize accumulator
- tstrw1: or a,(hl)
- inc hl
- djnz tstrw1
-
- ld e,0ffh
- ld a,e
- jr nz,xtstdsk ;exit point - non empty row
- inc e ;here on row full of nulls
- ld a,e
- xtstdsk: ;common exit from this routine
- pop bc
- pop hl
- ret
-
- ;**********************************************
- COMMON /ARDAT/
-
- ;COMMON data area - contains default values for a 64
- ;byte array useful for disk/user bitmapping.
- bitmap: dw 0 ;..filled in by ARRAYDEF
- hicol: dw 3 ;4 columns: 0,1,2,3
- hirow: dw 15 ;16 rows (0....15)
- dumaplen:
- dw 64 ;(3+1)*(15+1)
-
- maxdu: dw 0 ;transient d/u data
- curloc: dw 0 ;NDR entry pointer
-
- ;**********************************************
-
- end
-