Z88 Developers' Notes
Contents   Contents of System Calls

OS_Epr, File Eprom Interface

RST 20H, DEFW $F006

IN:
     A = reason code:
          EP_SAVE ($00) - blow RAM file to Eprom.
          EP_LOAD ($03) - read file from Eprom into RAM file.
          EP_DIR ($0F) - fetch (next) filename from Eprom.
     B, HL, IX arguments.
OUT:
     Fc = 1, A = error code.
     Fc = 0, reason code action successfully ended.
Registers changed after return:
     ..BCDEHL/IXIY same
     AF....../.... different


EP_DIR ($0F) - fetch filename from Eprom:
IN:  BHL = pointer to store returned filename (B=0 means local pointer).

OUT: Fc = 0:
          Filename returned at (HL), null-terminated.
     Fc = 1:
          A = RC_EOF ($09), no more filenames on File EPROM.
          A = RC_FAIL ($16), File EPROM not available.
Notes:
The first EPR_DIR call will return the first file name, if available. Subsequent calls will return the next filenames in chronological order (as the files were stored on EPROM). It is necessary to read all file names to the end, if you want to re-read the filenames from start at a later time. The buffer to receive the filenames from EPR_DIR must be sufficiently large, e.g. 128 bytes. The FILER uses this to get display all available filenames on EPROM. Filenames never contains RAM device references, but always reflect the complete path from the filing system (when blown to EPROM). Old 'deleted' files are not reflected in the list of filenames.


EP_SAVE ($00) - blow RAM file to Eprom.
IN:  BHL = pointer to filename, (B=0 means local pointer)

OUT: Fc = 0, file successfully blown on File EPROM.
     Fc = 1:
          A = RC_FAIL ($16), file couldn't be blown on EPROM.
Notes:
This call is equivalent to the <>ES command in the FILER. Any files on Eprom matching the filename in BHL will be marked 'deleted'.


EP_LOAD ($03) - read file from Eprom into RAM file.
IN:  BHL = pointer to filename (to be found on EPROM)
     IX = output file handle (to store contents of file on EPROM)


OUT: Fc = 0, file successfully moved to RAM filing system.
     Fc = 1:
          A = RC_FAIL ($16), file EPROM not available.
          A = RC_ROOM ($07), no room in filing system for data from EPROM.
Notes:
Before calling OS_Epr and EP_LOAD you should create a new file with an appropriate file name, using GN_Opf, A = OP_OUT. The filename to be searched on EPROM must not contain wildcards (the File EPROM is not organised as the RAM filing system). This call is equivalent to the <>EF command in the FILER. You must close the output file after the data has been copied from EPROM.