Get the disk catalog
Function AddressDescription
DOS_CATALOG 011EGet the disk catalog


Fills a buffer with part of the directory (sorted).

The filename specifies the drive, user and a (possibly ambiguous) filename.

Since the size of a directory is variable (and may be quite large), this routine permits the directory to be catalogued in a number of small sections. The caller passes a buffer pre-loaded with the first required filename, or zeroes for the start of the directory. The buffer is loaded with part (or all, if it fits) of the directory sorted in ASCII order. If more of the directory is required, this routine is re-called with the buffer re-initialised with the last file previously returned. This procedure is followed repeatedly until all of the directory has been catalogued.

Note that +3DOS format disks (which are the same as single-sided, single track AMSTRAD PCW range format disks) may have a maximum of 64 directory entries.

Entry Parameters

Register Content
B n+1 size of buffer in entries, must be >= 2
C Filter:
Bit 0 = include system files if set
Bits 1…7 reserved
DE Address of buffer, first entry initialised
HL Address of filename, wildcards permitted

Exit Parameters

If OK:
Carry true
A corrupt
B number of completed entries in buffer, 0…n.
If B=n then there may be more entries for subsequent calls
Carry false
A=Error code
B corrupt
C DE HL IX corrupt, all other registers preserved.

Buffer format

The buffer passed to this routine consists of 2 or more entries, with the first one initialised with the first filename required. It is valid for the first entry to be all zero's.

If the buffer is too small for the directory then it can be called again with entry 0 being a copy of entry n from the previous call.

Directory Entry Format
Bytes Length Content
078 Filename in ASCII, left justified, space padding
8103 Type in ASCII, left justified, space padding
11122 File size in KB

The file size is the disk space allocated, not the actual file size.

Last modified November 24, 2021: Start of +3DOS documentation (253d8cc)