Read Directory in BASIC

Post Reply
TomXP411
Posts: 1802
Joined: Tue May 19, 2020 8:49 pm

Read Directory in BASIC

Post by TomXP411 »


This reads the disk directory in BASIC. This is a super simple example and doesn't actually parse the files... it's just smart enough to read "$" and print it to the screen. 




 



This version is smarter. The directory is actually read as a BASIC file. Each line has a 2 byte link address, 2 byte line number, a variable length text string, and a null. 




So this program reads and discards the link address, reads a 16-bit number for the file size, then reads until the null to get the filename and filetype.




 




 


Attachments
DIR.PRG
Read Directory in BASIC
(968 Bytes) Downloaded 356 times
Read Directory in BASIC
Read Directory in BASIC
Capture.PNG (56.31 KiB) Viewed 4665 times
Post Reply