home *** CD-ROM | disk | FTP | other *** search
- ;Library Name: ARRAYLIB
- ;Module Name: NDRACCESS
- ;Author: Al Hawley
- ;Date: 06 Mar 1987
- ;Version number: 1.0a
- ;Previous version: 1.0 dated 4 March 1987
-
- ;Version History:
-
- ;Program Function: ARRAYLIB is a collection of subroutines which
- ; implement the management of byte arrays in programs written
- ; for Z80 or HD64180 based computers. This module is one of the
- ; set, and may require the presence of others.
-
- ;***************************************************
- ; 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 ndraccess
- ;This module contains the following routines:
- public getndre,gtnxtdu
- ;..and uses the following external routines:
- ext getndr
-
- ;**********************************************
-
- getndre:
- ;get address of system NDR with error checking
- call getndr
- or a,a
- ld a,4 ;error code - No NDR
- scf ;in case of error
- ret z ;..null return is error
- ld a,(HL) ;bet 1st byte of NDR
- or a,a ;if null, NDR is empty
- ld a,5 ;error code - empty NDR
- scf ;indicate error
- ret z ;return with error code, Cy set
- xor a ;else, reset cy
- ret ;normal return, no error
-
- ;**********************************************
-
- gtnxtdu:
- ;get and return in BC the word at the address
- ;in curloc:, then increment that address by 18.
- ;The addresses are presumed to be pointers into
- ;a system named directory structure.
- ;curloc must be initialized on entry.
- ;on normal exit,
- ; A > 0, Flags = NZ,NC
- ; BC = Disk, User from NDR
- ; HL = pointer to next NDR entry
- ;on exit with pointer beyond valid NDR entries,
- ; A = 0, Flags = Z,NC
- ; BC = 0,(undefined)
- ; HL = undefined
- ;Error exit:
- ; A = 0, Flags = Z, C
- ; HL = address of curloc:
- ;registers affected: AF, BC, HL
-
- ld hl,(curloc) ;pick up pointer to data
- ld a,h
- or a,a ;unititilized of null
- jr z,uninit
-
- push de
- ld b,(hl) ;get drive (1..16)
- ld a,b
- or a,a ;test for null
- jr z,nomore
-
- inc hl
- ld c,(hl) ;get user number(0..31)
- ld de,17 ;distance to next entry
- add hl,de
- ld (curloc),hl ;ready for next call
- pop de
- ret
-
- nomore:
- ld a,(curloc+1) ;mark curloc invalid
- pop de
- ret
-
- uninit: ld hl,curloc ;return place to store pointer
- scf ;set Cy to show error
- 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
-