;Library Name: ARRAYLIB ;Module Name: ASKDSK ;Author: Al Hawley ;Date: 31 Mar 1987 ;Version number: 1.0c ;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 Voice Phone at: 213-649-3575 ; ;*************************************************** MACLIB ARRHDR 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 ;********************************************** IF ZAS COMMON ;common block for ZAS ELSE COMMON /ADATA/ ;common block for M80, SLR ENDIF ;COMMON data area - contains default values for a 64 ;byte array useful for disk/user bitmapping. bitmap: ds 2 ;..filled in by ARRAYDEF hicol: ds 2 ;default is 4 columns: 0,1,2,3 hirow: ds 2 ;default is 16 rows (0....15) dumaplen: ds 2 ;default is (3+1)*(15+1) maxdu: ds 2 ;transient d/u data curloc: ds 2 ;NDR entry pointer ;********************************************** end