home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
F
/
LPUT22.LBR
/
WILDEX.ZZ0
/
WILDEX.Z80
Wrap
Text File
|
1991-08-23
|
1KB
|
64 lines
;WILDEX - wildcard expansion module
; S. Kluger 04/15/84
;
; 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
RET Z ; Nothing found -- error
CALL MOVEN ; Move name
WLOOP: PUSH HL
LD C,SNEXT ; Search for next
CALL BDOS
POP HL
RET M ; Finished
CALL MOVEN
JR WLOOP
;
MOVEN: PUSH DE
PUSH HL
LD DE,(BUFPTR)
RRCA
RRCA
RRCA
ADD A,80H
LD L,A
LD H,0
LD BC,16 ; Move 16 chars
LDIR
LD (BUFPTR),DE
POP HL
POP DE
INC HL
RET
DSEG
;
BUFPTR: DS 2
END