2020-12-08 01:16:41 +00:00
|
|
|
%import textio
|
|
|
|
%import diskio
|
|
|
|
%zeropage basicsafe
|
|
|
|
%option no_sysinit
|
|
|
|
|
2023-06-03 17:14:45 +00:00
|
|
|
; Note: this program can be compiled for multiple target systems.
|
|
|
|
|
2020-12-08 01:16:41 +00:00
|
|
|
main {
|
|
|
|
sub start() {
|
2023-11-19 17:59:03 +00:00
|
|
|
diskio.drivenumber = 8
|
|
|
|
txt.print("showing the full directory of drive 8:\n")
|
2023-05-01 23:48:56 +00:00
|
|
|
void diskio.directory()
|
2021-01-08 15:56:17 +00:00
|
|
|
txt.nl()
|
2020-12-08 01:16:41 +00:00
|
|
|
|
2023-11-19 17:59:03 +00:00
|
|
|
if diskio.lf_start_list("test*") {
|
|
|
|
txt.print("\nfiles starting with 'test':\n")
|
2020-12-08 02:28:29 +00:00
|
|
|
while diskio.lf_next_entry() {
|
|
|
|
txt.print(diskio.list_filename)
|
|
|
|
txt.print(" ")
|
|
|
|
txt.print_uw(diskio.list_blocks)
|
|
|
|
txt.print(" blocks\n")
|
|
|
|
}
|
|
|
|
diskio.lf_end_list()
|
|
|
|
} else {
|
|
|
|
txt.print("error\n")
|
|
|
|
}
|
2020-12-08 01:16:41 +00:00
|
|
|
|
2023-11-19 17:59:03 +00:00
|
|
|
if diskio.lf_start_list("*bin") {
|
|
|
|
txt.print("\nfiles ending with 'bin':\n")
|
2020-12-08 02:28:29 +00:00
|
|
|
while diskio.lf_next_entry() {
|
|
|
|
txt.print(diskio.list_filename)
|
|
|
|
txt.print(" ")
|
|
|
|
txt.print_uw(diskio.list_blocks)
|
|
|
|
txt.print(" blocks\n")
|
|
|
|
}
|
|
|
|
diskio.lf_end_list()
|
|
|
|
} else {
|
|
|
|
txt.print("error\n")
|
|
|
|
}
|
2020-12-08 01:16:41 +00:00
|
|
|
|
2023-05-01 23:48:56 +00:00
|
|
|
if diskio.lf_start_list(0) {
|
2020-12-08 02:28:29 +00:00
|
|
|
txt.print("\nfirst 10 files:\n")
|
|
|
|
ubyte counter=0
|
|
|
|
while counter < 10 and diskio.lf_next_entry() {
|
|
|
|
txt.print(diskio.list_filename)
|
|
|
|
txt.print(" ")
|
|
|
|
txt.print_uw(diskio.list_blocks)
|
|
|
|
txt.print(" blocks\n")
|
|
|
|
counter++
|
2020-12-08 01:16:41 +00:00
|
|
|
}
|
2020-12-08 02:28:29 +00:00
|
|
|
diskio.lf_end_list()
|
|
|
|
} else {
|
|
|
|
txt.print("error\n")
|
2020-12-08 01:16:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|