; TITLE "SDIR08 - Syslib 4.0" NAME ('DIRNPA') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SDIR08.Z80 Ver 1.5 by Richard Conn ; Date : 17 Sep 89 ; Version : 1.6 ; Module : SDIR08 ; Abstract: This module contains the routine DIRNPACK which ; restructures the selected entries in a directory buffer ; to select only those entries which were previously not ; selected. A required side effect of this routine is ; that the flag extent (set by DIR:) be correct. In most ; cases, a default of 0 is Ok, except when the extent ; size is greater then 16K. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC DIRNPACK ; From SYSLIB Get.. EXT DIRPACK, SDFCHK ; Definitions ESIZE EQU 16 ; Entry size in bytes .Z80 CSEG ;=============================================================== ; NAME - DIRNPACK ; Entry: HL - Points to a Directory Buffer ; BC - Number of entries in the Buffer ; Exit : - Nothing returned ; Uses : - None ; Special Requirements: A required side effect is that the flag ; extent (Set by DIR:) be correct. In most cases, default ; of 0 is Ok, except when extent size is greater than 16K ;=============================================================== DIRNPACK: PUSH HL ; Save Regs PUSH DE PUSH BC PUSH AF DNPACK: LD A,B ; Done? OR C JR Z,DNPAK1 DEC BC ; Count down BIT 7,(HL) ; Is it selected? JR NZ,DNPAK9 ; ..jump if so to Unselect SET 7,(HL) ; Else select it PUSH BC ; Save counter CALL SDFCHK ; Check for Flags POP BC ; Get counter JR Z,DNPAK0 DNPAK9: RES 7,(HL) ; Delect this file DNPAK0: LD DE,ESIZE ; Point to next entry ADD HL,DE JR DNPACK DNPAK1: POP AF ; Restore regs POP BC POP DE POP HL JP DIRPACK ; ..jump to DIRPACK and return END