TITLE "Z3QNDR - Z3lib 4.0" ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from Z3QNDR.Z80 Ver 1.1 by Richard Conn ; Date : 8 Mar 87 ; Version : 1.2 ; Module : Z3QNDR ; Abstract: This module contains the routine DIRNDR which ; searches the current Named Directory for the specified ; DIR name, returning DU: if found. It also contains ; the routine DUNDR which searches the current Named ; Directory for a given DU: returning a pointer to the ; DIR: name if found ; Revision: ; 1.3 - 22 Jun 91 - Changed GETNDR to GETND0 for speed. HFB ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC DIRNDR, DUNDR ; External References EXT ENVPTR, GETND0, CAPS .Z80 CSEG ;=============================================================== ; NAME - DIRNDR ; Entry: HL - Points to a name string ; Exit : HL - Address of NDR entry if found ; BC = Disk/User, (B = Disk # (A=1), C = User #) if found ; A <> 0, Zero Flag Reset (NZ) if Ok ; A = 0, Zero Flag Set (Z) if Not Found/NO NDR Buffer ; Uses : AF,BC,HL ; Special Requirements: None ;=============================================================== DIRNDR: PUSH DE LD (DNAME),HL ;save ptr to name CALL GETND0 ;get ptr to NDR JR Z,DIREX DIR1: LD A,(HL) ;check for done OR A ;0=done JR Z,DIREX CALL COMPDIR ;compare dir names JR Z,DIR2 ;found LD DE,18 ;pt to next entry ADD HL,DE JR DIR1 DIR2: LD B,(HL) ;B=disk INC HL LD C,(HL) ;C=user DEC HL ;HL = address of entry DUOK: OR 0FFH ;NZ for OK DIREX: POP DE RET ; Compare entry pted to by HL with that in buffer ; Return with Z if match COMPDIR: PUSH HL PUSH DE INC HL ;pt to name INC HL LD DE,(DNAME) ;HL pts to dir entry, DE pts to target LD B,8 ;8 chars CDIR1: LD A,(DE) ;get target CALL CAPS ;capitalize CP (HL) ; Compare to DIR JR NZ,CDIR2 INC HL ;pt to next INC DE DJNZ CDIR1 ;count down CDIR2: POP DE ;restore regs POP HL RET ;=============================================================== ; NAME - DUNDR ; Entry: BC = Desired Disk/User, (B = Disk (A=1), C = User) ; Exit : HL - Address of NDR entry if found ; A <> 0, Zero Flag Reset (NZ) if Ok ; A = 0, Zero Flag Set (Z) if Not Found/NO NDR Buffer ; Uses : AF,BC,HL ; Special Requirements: None ;=============================================================== DUNDR: PUSH DE CALL GETND0 ;get ptr to NDR JR Z,DIREX DU1: LD A,(HL) ;check for done OR A ;0=done JR Z,DIREX CP B ;check disk JR NZ,DU2 ;no match yet INC HL LD A,(HL) ;get user DEC HL CP C ;check user JR Z,DUOK ; Exit OK if found ; ..else fall thru to check next DU2: LD DE,18 ;pt to next entry ADD HL,DE JR DU1 ; Data Storage/Buffers DSEG ; Put in Data Segment DNAME: DEFS 2 ;pointer to target name buffer END