;WILDEX - wildcard expansion module ; S. Kluger 04/15/84 ; ; Modified 8/27/91 by Bruce Morgen to further shorten code. ; ; Modified 8/23/91 by Howard Goldstein to correct usage instructions ; and shorten code. ; ; This module, for use with SYSLIB, can be used ; to expand a wildcard filename into a table of ; file names as found in current DU: ; ; ENTRY: ; HL = .buffer ; DE = .afn fcb ; ; EXIT: ; HL = number of files ; ACC= zero flag set if error, clear if ok ; the buffer contains (HL) file names of 16 char each ; Char 0 contains the user number! ; SFIRST EQU 17 SNEXT EQU 18 ; EXTRN BDOS ; PUBLIC WILDEX ; WILDEX: LD (BUFPTR),HL LD C,SFIRST CALL BDOS LD HL,0 CP 0FFH JR NZ,MOVEN ; Move name RET ; Nothing found -- error WLOOP: PUSH HL LD C,SNEXT ; Search for next CALL BDOS POP HL RET M ; Finished MOVEN: PUSH DE PUSH HL LD DE,(BUFPTR) RRCA RRCA RRCA ADD A,80H LD BC,16 ; Move 16 chars LD L,A LD H,B LDIR LD (BUFPTR),DE POP HL POP DE INC HL JR WLOOP ; DSEG ; BUFPTR: DS 2 END