; BDOS TEST10 filename search function0e,11,12
;2012/3/19 4/4 8/27
;
ORG $0100
FCALL=$0005
FCB=$005C
DMA=$0080
;
LOOP:LD DE,INPMSG
CALL MSGDP
LD C,01
CALL FCALL
CP 1A;^z
RET Z
CP 30
JP Z,DNOPASS
AND 0F
DEC A
LD E,A
LD C,0E
CALL FCALL
DNOPASS:CALL CRLF
LD C,11;first file search
LD DE,FCB
CALL FCALL
CP FF
JP Z,NOFILE
;
LD HL,DMA
LD DE,$0020
OR A;dirctory code 00-03
LOOP1: JP Z,NMDISP
ADD HL,DE
DEC A
JP LOOP1
NMDISP:INC HL;pass drive no.
LD B,08
NMDISP2:LD A,(HL)
CP 20
JP Z,NMDISP3
CALL ADP
NMDISP3:INC HL
DEC B
JP NZ,NMDISP2
LD A,2E;"."
CALL ADP
LD B,03
NMDISP4:LD A,(HL)
CALL ADP
INC HL
DEC B
JP NZ,NMDISP4
CALL CRLF
;next file search
LD C,12;next file search
LD DE,FCB
CALL FCALL
CP FF
JP Z,END
LD HL,DMA
LD DE,$0020
OR A;dirctory code 00-03
NXTSRCH:JP Z,NMDISP
ADD HL,DE
DEC A
JP NXTSRCH
;
NOFILE:LD DE,NFMSG
CALL MSGDP
JP LOOP
;
END:LD DE,ENDMSG
CALL MSGDP
JP LOOP
;
MSGDP:LD C,09
CALL FCALL
RET
;
;CL & LF
CRLF:LD A,0D
CALL ADP
LD A,0A
JP ADP
;space disp
SPDP:LD A,20
;A disp
ADP:PUSH BC
PUSH HL
LD E,A
LD C,02
CALL FCALL
POP HL
POP BC
RET
;
INPMSG:"drvn"
"o."
DB 3F;?
DB 24;$
NFMSG:"not "
"foun"
"d"
DB 0D
DB 0A
DB 24;$
ENDMSG:"end"
DB 0D
DB 0A
DB 24;$
;
|