System information

FUNCTION 17: SEARCH FOR FIRST
Entry Parameters:
RegisterC: 11H
Registers DE: FCB Address
Returned Value:
Register A: Directory Code
Search First scans the directory for a match with the file given by the FCB addressed by DE. The
value 255 (hexadecimal FF) is returned if the file is not found; otherwise, 0, 1, 2, or 3 is returned
indicating the file is present. When the file is found, the current DMA address is filled with the
record containing the directory entry, and the relative starting position is A * 32 (that is, rotate
the A register left 5 bits, or ADD A five times). Although not normally required for application
programs, the directory information can be extracted from the buffer at this position.
An ASCII question mark (63 decimal, 3F hexadecimal) in any position from fl through ex
matches the corresponding field of any directory entry on the default or auto-selected disk drive.
If the dr field contains an ASCII question mark, the auto disk select function is disabled and the
default disk is searched, with the search function returning any matched entry, allocated or free,
belonging to any user number. This latter function is not normally used by application programs,
but it allows complete flexibility to scan all current directory values. If the dr field is not a
question mark, the s2 byte is automatically zeroed.
5.2 Call Conventions CP/M Operating System Manual
5-21