NEC CP/M-86 System Reference Manual page 49

Advanced personal computer
Table of Contents

Advertisement

Basic Disk Operating System (BDOS) Functions
The Open File function returns a code, called a directory code, with a value of 0
through 3 if the open was successful, or OFFH (255 decimal) if the file could not be
found. If question marks occur in the FCB, the first matching FCB is activated. The
current record (" cr") must be zeroed by the program if the file is to be accessed
sequentially from the first record.
CLOSE FILE
ENTRY
CL: 10H
DX: FCB
Offset
RETURN
FUNCTION
16
AL: Return Code
CLOSE FILE
The Close File function is the inverse of the Open File function in its operation.
Given that the FCB addressed by DX has been previously activated through an
Open File or Make File function (function 15 or 22), the Close File function
permanently records the new FCB in the referenced disk directory. The FCB
matching process for the close is identical to the open function. The directory code
returned for a successful Close File function is 0, 1, 2, or 3, while OFFH (255
decimal) is returned if the file name could not be found in the directory. A file need
not be closed if only read operations have taken place. If write operations have
occurred, however, the Close File function is necessary to permanently record the
new directory information.
SEARCH FOR FIRST
ENTRY
CL: IlH
DX: FCB
Offset
FUNCTION
17
SEARCH FOR FIRST
RETURN
AL: Return
Code
The Search for First function scans the directory for a match with the file given by
the FCB addressed by DX. The value OFFH (255 decimal) is returned if the file is
not found; otherwise 0, 1, 2, or 3 is returned indicating the file is present. If the file is
found, the buffer at the current DMA address is filled with the record containing the
directory entry, and its relative starting position is calculated as AL
*
32 (i.e., rotate
the AL register left 5 bits). Although it is not normally required for application
programs, the directory information can be extracted from the buffer at this
position.
4-15

Advertisement

Table of Contents
loading

Table of Contents