; BDOS TEST10 filename search function11,12
;2012/3/19 8/24
;
ORG $0100
FCALL=$0005
FCB=$005C
DMA=$0080
;
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
JP MSGDP
;
END:LD DE,ENDMSG
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
;
NFMSG:"not "
"foun"
"d"
DB 24;$
ENDMSG:"end"
DB 24;$
;
|