This program uses the
Beta BASIC 4.0+D CAT$ function
to get the directory of the ZX Spectrum 128's RAM disc
and then prints the catalogue on screen;
the catalogue resembles the Plus D's disk one.
Screenshot
Listing
DEF PROC ramcat
REM A RAM disc cataloguer procedure
REM for ZX Spectrum 128.
REM Written in Beta Basic 4.0+D.
REM Copyright (C) 2010 Marcos Cruz (programandala.net)
REM License programandala.net/pl
REM 2010-05-23 First version.
LOCAL c$,files,f,base,n$,type,length
LET c$=CAT$()
LET files=LEN c$/13
PRINT "* RAM DISC CATALOGUE *"''
FOR f=1 TO files
LET base=(f-1)*13+1
LET n$=c$(base TO base+9)
LET type=CODE (c$(base+10))
LET length= NUMBER(c$(base+11 TO base+12))
PRINT USING "##";f;" ";n$;" ";
ON type+1
PRINT "BAS ";
PRINT "D.ARRAY";
PRINT "$.ARRAY";
PRINT "CDE ";
PRINT USING "######" ;length
NEXT f
PRINT DPEEK(23429)+65536*PEEK (23431);" free bytes"'files;" file";"s" AND files<>1
END PROC
CLEAR
SAVE d*"ramcat"
SAVE "ramcat"