; TITLE "SDIR10 - Syslib 4.0" NAME ('SDFCHK') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SDIR10.Z80 Ver 1.5 by Richard Conn ; Date : 17 Sep 89 ; Version : 1.6 ; Module : SDIR10 ; Abstract: This module contains the routine SDFCHK which checks ; the System Bit and User Number of an entry against the ; selection flags passed to directory sort routines. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC SDFCHK ; From SYSLIB Get.. EXT SELFLG .Z80 CSEG ;=============================================================== ; NAME - SDFCHK ; Entry: HL - Points to Directory Buffer ; Exit : A = 0 and Zero Flag Set (Z) if entry selected ; A = 0FFH and Zero Flag Reset (NZ) if Not ; Uses : AF ; Special Requirements: None ;=============================================================== SDFCHK: PUSH DE ; Save FCB ptr PUSH HL ; Save Entry ptr LD DE,10 ; Check System bit ADD HL,DE ; HL pts to System bit BIT 7,(HL) ; Test MSB of System byte POP HL ; Restore ptrs POP DE LD A,(SELFLG) ; Get Flag byte JR Z,NSYBIT ; ..jump if System Bit Not Set ; It is a System File, so look at Bit 6 of Flag BIT 6,A ; Are we selecting System Files? (Bit 6) JR NZ,DSUSER ; ..jump if so to look at User NOMAT: OR 0FFH ; Not a Match, so return Not Zero (NZ) RET ; It is a Non-System File, so look at Bit 7 of Flag NSYBIT: BIT 7,A ; Are we selecting Non-System files? (Bit 7) JR Z,NOMAT ; ..jump to No Select if not ; Now check for proper user area DSUSER: BIT 5,A ; Are we selecting All Users? JR NZ,YESMAT ; ..jump to automatically match if Set XOR (HL) ; Compare to FCB User field AND 1FH ; Mask off all but user number (Low 5 bits) JR NZ,NOMAT ; ..Skip if User Number not the same YESMAT: XOR A ; Have a match! Set Zero Status RET END