Routines for work with directories and files: DISK.8 - change disk directory (root, upper) GETFILES.8 - read files from disk PRNLIST.8 - print the files (or any data) SORTLIST.8 - sort the files (or any data) README.TXT - this text LISTDIR.8 - demo program source LISTDIR.COM - demo program Description of the routines: ;********* ;GET_FILES ;loads file_list table with info about the files in directory ;the structure of the info is following: ; xxxxxxxx.xxxZ 13 bytes file name ASCIIZ string ; 00 1 byte reserved ; 00 1 byte reserved ; ? 1 byte file attribs ; xxxx 4 bytes file size ; one file has 20 bytes record ; the rutine works within one segment CS=ES=DS ; (I hope someone will adapt this routine for all segments range) ; ;INPUT: CL - file attributes ; CH - maximum of files to load into the table (1-254) ; DX - pointer to file spec. ASCIIZ ; SI - pointer to DTA (usually 080 hexa) ; DI - pointer to file_list table ; ;OUTPUT: CY - set - error ; AX - error code ; CY - cleared - OK ; AX - number of files in the file_list table ; ;DESTROYS: flags ; AX ;---------------------------------- ;********************************* ;PRINT_LIST ;prints records in the list onto the standard output device (strdout) ;every record must be zero terminated ; ;INPUT: SI pointer to the list ; DL total od records ; CX record size ;OUTPUT registers: none ; data on strdout ;DESTROYS flags ;--------------------------------- ;********************************* ;SORT_LIST ;sorts records in a list - designed for file_list with info about ;directory files but can be used universally ; ;INPUT: SI pointer to list of records ; CX size of record in bytes ; DL total of records in list ; AL - 0 sort all records ; - 1 sort directory records (#-note) first ;OUTPUT: none ;DESTOYS: flags ; ; # note: directory record is bit 4 (starting from 0) in ; file attributes that are save on offset 0F in a record ; see GET_FILES to learn more ;------------------------------------ ;*********************************** ;SET_ROOT ;will set root directory on current drive ;the same as DOS "cd \" command. ;INPUT: none ;OUTPUT: CY - cleared - OK ; - set - error ; than AX - DOS error number ;DESTROYS: flags ; AX ;----------------------------------- ;*************************************** ;CD_UP ;will set the up-dir (if possible) ;similar to DOS "cd .." command ; ;INPUT: none ;OUTPUT: CY - cleared - OK ; - set - error ; than AX - DOS error number ;DESTROYS: flags ; AX ;-----------------------------------