Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
titleRST 20H, DEFB $48
     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)
	 DE < $8000, return result in (DE)
     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 


This information can also be obtained by OS_Si/SI_Enq.


DE must be in segment 0 or 1, 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)