Z88 Developers' Notes
Contents   Contents of System Calls

OS_Frm, file read miscellaneous

RST 20H, DEFB $48
 

IN:  A = reason code
     FA_PTR ($01)   return sequential pointer (32bit integer)
     FA_EXT ($02)   return extent (size) of file (32bit integer)
     FA_EOF ($03)   end of file enquiry
     FA_BST ($04)   buffer status (internal OZ usage)

     DE = 0, return result in DEBC registers (D = MSB, C = LSB)
     IX = file handle (previously obtained with GN_Opf)
     IX = $FFFF then system values are returned
OUT, if call successful:
     Fc = 0
     Fz = 1, end of file (FA_EOF)
     Fz = 0, not end of file (FA_EOF)

     DEBC = 32bit result (returned by FA_PTR, FA_EXT, FA_BST)
     (D = most significant byte, C = least significant byte)
OUT, if call failed:
     Fc = 1
     A = error code:
          RC_HAND ($08), bad handle
Registers changed after return:
     ......HL/IXIY same
     AFBCDE../.... different

Notes:
     If IX(in) = FFFF then the following information is obtained:
     FA_PTR:
          DE = number of free handles
          BC = version number
     FA_EXT:
          DEBC = estimate of free memory
     FA_EOF:
          Fz = 1, if Z88 is expanded, else Fz = 0
Bugs:
DE must be 0, otherwise the call is unreliable. DE should have been interpreted as pointer to store file information but the bug was never fixed in V2.2 / 3.0.

Related calls:
GN_Cl, close file
GN_Del, delete a file from memory
GN_Opf, open file/resource (wildcard search)
GN_Ren, rename file
OS_Cl, internal close (OZ usage)
OS_Del, file delete (internal OZ usage)
OS_Fwm, file write miscellaneous
OS_Gb, get byte from file (or device)
OS_Gbt, get byte from file (or device) with timeout
OS_Mv, move bytes between stream and memory
OS_Op, internal open (OZ usage)
OS_Pb, write byte to file, device
OS_Pbt, write byte to file, device with timeout
OS_Ren, file rename (internal OZ usage)