TITLE "Z3GNDR - Z3lib 4.0" NAME ('GETNDR') ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from Z3GNDR.Z80 Ver 1.1 by Richard Conn ; Date : 23 Jul 89 ; Version : 1.3 ; Module : Z3GNDR ; Abstract: This module contains the routine GETNDR which ; returns the address of the Named Directory Buffer and ; the maximum number of entries. ; Revision: ; 1.5 - 5 Aug 91 - Fixed GETNDR per Howard Goldstein. HFB ; 1.4 - 22 Jun 91 - Corrected code to reflect # 128-byte sectors ; in NDR vice # entries. Added second internal ; routine to return # entries. HFB ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC GETNDR, GETND0 ; External References EXT @GET2 .Z80 CSEG ;=============================================================== ; NAME - GETNDR ; Entry: - None ; Exit : HL - Points to the Named Directory Buffer if found ; A = # of 128-byte Records in NDR, Zero Clear (NZ) if OK ; A = 0, Zero Flag Set (Z) if No NDR ; Uses : AF,HL ; Special Requirements: None ; NOTE : This routine works properly up to 9 records at which ; time it is one record off. ;=============================================================== GETNDR: CALL GETND0 ; Get Pointer and # of entries RET Z ; ..Quit if No NDR PUSH BC ; Save regs LD B,0 ; .set up counter dec a ;1.5 GETN0: INC B ; Bump counter SUB 7 ; .Take away # of entries in 1 record JR NC,GETN0 ; ..loop til we exceed limit LD A,B ; Move Record count to A POP BC ; .restore regs RET ; ..and exit ;=============================================================== ; NAME - GETND0 ; Entry: - None ; Exit : HL - Points to the Named Directory Buffer if found ; A = Max # of Entries in NDR, Zero Clear (NZ) if OK ; A = 0, Zero Flag Set (Z) if No NDR ; Uses : AF,HL ; Special Requirements: None ;=============================================================== GETND0: PUSH DE ;save DE LD DE,15H ;pt to entry JP @GET2 ; Get indexed 16 and 8-bit values END