Versions Compared

Key

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

...

Code Block
titleRST 20H, DEFB $87
IN:
     A = reason code
     HL, IX arguments

     Reason codes are as follows:

     DR_GET ($01)   get handle for a DOR name (internal use)
     DR_DUP ($02)   duplicate DOR
     DR_SIB ($03)   return brother DOR
     DR_SON ($04)   return child DOR
     DR_FRE ($05)   free DOR handle
     DR_CRE ($06)   create blank DOR
     DR_DEL ($07)   delete DOR
     DR_INS ($08)   insert DOR
     DR_RD  ($09)   read DOR record
     DR_WR  ($0A)   write DOR record
	 DR_OP  ($0B)   open explicit filename (OZ 5.0 and newer)
     DR_FRRUSE ($0C)   filehandle recordin readuse (OZ 5.0 and newer)

OUT, if call successful:
DR_FRW ($0D)   file recordFc write= (OZ0
5.0 and newer)   returned values depend DR_USEon A($0Ein)

OUT, handleif incall usefailed:
(OZ 5.0 and newer)

OUT, if call successful:
     Fc = 0
     returned values depend on A(in)

OUT, if call failed:
     Fc   Fc = 1
     A = error code:
          RC_HAND ($08), bad handle
          RC_BAD ($04), bad argument
          RC_ROOM ($07), no room
          RC_EOF ($09), end of file

Registers changed after return:
     not documented. 

...

  • This call is the optimized equivalent of GN_Opf / OP_DOR. It is used by GN_Opf itself and allows a faster file open.
  • It is recommended to use this call before making file DOR operation like reading filename, timestamp...
  • It always create a device type handle ($01) which is required to perform DOR header operation. Type can be changed by calling OS_Fn / FN_CH (in order to perform file I/O).
  • API call implemented in OZ 5.0
Code Block
titleDR_FRR ($0C), file record read (OZ 5.0 and newer)
IN:
     B = record type letter (Name, Creation, Update, eXtent, Efs, Attribute)
     DE = user buffer address (to store information of read, always local, in S0 or S1)
     IX = DOR handle (device or file type)

OUT, if call successful:
     Fc = 0
     original IX DOR handle is still valid

OUT, if call failed:
     Fc = 1
     original IX is still valid
     A = error code
          RC_BAD ($04), bad argument

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../.... different

Notes

  • This call is the optimized equivalent of DR_RD for file record. It is used internally during file I/O.
  • It is recommended to use this call to perform file DOR operation like reading filename, timestamp...
  • It accepts any handle type (device or file type). It can be called after a handle given by GN_Opf or OS_Dor / DR_OP.
  • API call implemented in OZ 5.0
Code Block
titleDR_FRW ($0D), file record write (OZ 5.0 and newer)
IN:
     B = record type letter (Name, Creation, Update, eXtent, Efs, Attribute)
     DE = user buffer address (to store information to be written, always local, in S0 or S1)
     IX = DOR handle (device or file type)

OUT, if call successful:
     Fc = 0
     original IX DOR handle is still valid

OUT, if call failed:
     Fc = 1
     original IX is still valid
     A = error code
          RC_BAD ($04), bad argument

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../.... different

Note

  • This call is the optimized equivalent of DR_WR for file record. It is used internally during file I/O.
  • Read notes about DR_FRR./ FN_CH (in order to perform file I/O).
  • API call implemented in OZ 5.0


Code Block
titleDR_USE ($0E$0C), handle in use (OZ 5.0 and newer)
IN:
     IX = DOR handle

OUT, if call successful:
     Fc = 0
  ,   handle or device is NOT already in use

OUT, if call failed:
     Fc = 1
    , original IX is still valid
     A = error code
          RC_USE, already in use

Registers changed after return:
     ..BCDEHL/IXIY same
     .F....../.... different

...