Z88 Developers' Notes
Contents   Contents of System Calls

OS_Op, internal open

RST 20H, DEFW $EA06

IN:

     A = OP_IN ($01), open file for input
          IX = (file) DOR handle

     A = OP_OUT ($02), open (create) file for output
          IX = (directory) DOR handle
          HL = pointer to ASCII filename (null-terminated)

     A = OP_UP ($03), open for update
          IX = (file) DOR handle

     A = OP_MEM ($04), open memory (for input)
          BHL = pointer to memory
          C = size (max. 255 bytes)

     A = OP_DIR ($05), create directory
          IX = (directory) DOR handle
          HL = pointer to ASCII filename (null-terminated)
OUT, if call successful:
     Fc = 0
     A(in) = OP_IN:
          IX = file handle
     A(in) = OP_OUT:
          IX = file handle
     A(in) = OP_UP:
          IX = file handle
     A(in) = OP_MEM:
          IX = file handle
     A(in) = OP_DIR:
          IX = DOR handle
Registers changed after return:
     ..BCDEHL/..IY same
     AF....../IX.. different
Notes:
Internal operating system usage.
Applications must use the GN_Opf call.
Bugs:
 

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_Frm, file read miscellaneous
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_Pb, write byte to file, device
OS_Pbt, write byte to file, device with timeout
OS_Ren, file rename (internal OZ usage)