Function 3Eh            Close File with Handle

Closes an open file.

Entry AH = 3Eh
BX = File handle

Return AX = Error code, if CF is set
| 06h Invalid handle

──────────────────────────────────────────────────────────────────

This function flushes the file's buffers, unlocks any locked
regions of the file, releases the handle, and updates the disk
directory to reflect any changes in the file size, date, or time.

Although closing a file invalidates the corresponding handle, DOS
may reuse the handle to identify a file that is subsequently
opened or created. Programs can use Is File or Device Remote
(function 440ah) to determine whether a given handle is valid.