System information

If a directory element is matched, the relevant directory information is copied into bytes d0
through dn of FCB, thus allowing access to the files through subsequent read and write
operations. The user should note that an existing file must not be accessed until a successful open
operation is completed. Upon return, the open function returns a directory code with the value 0
through 3 if the open was successful or 0FFH (255 decimal) if the file cannot be found. If
question marks occur in the FCB, the first matching FCB is activated. Note that the current
record, (cr) must be zeroed by the program if the file is to be accessed sequentially from the first
record.
FUNCTION 16: CLOSE FILE
Entry Parameters:
Register C: 10H
Registers DE: FCB Address
Returned Value:
Register A: Directory Code
The Close File function performs the inverse of the Open File function. Given that the FCB
addressed by DE has been previously activated through an open or make function, the close
function permanently records the new FCB in the reference disk directory see functions 15 and
22. The FCB matching process for the close is identical to the open function. The directory code
returned for a successful close operation is 0, 1, 2, or 3, while a 0FFH (255 decimal) is returned if
the filename cannot be found in the directory. A file need not be closed if only read operations
have taken place. If write operations have occurred, the close operation is necessary to record the
new directory information permanently.
5.2 Call Conventions CP/M Operating System Manual
5-20