| Z88 Developers' Notes | ||
|---|---|---|
| Contents | Contents of System Calls | |
OS_Frm, file read miscellaneous
RST 20H, DEFB $48
IN: A = reason codeOUT, if call successful:
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
Fc = 0OUT, if call failed:
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)
Fc = 1Registers changed after return:
A = error code:
RC_HAND ($08), bad handle
......HL/IXIY sameNotes:
AFBCDE../.... different
If IX(in) = $FFFF then the following information is obtained:Buffer status
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
FA_BST only works with serial coms handle in IX (else Fc=1 and A=RC_Hand). It returns:
D = Tx buffer used slots
E = Tx buffer free slots
H = Rx buffer used slots
L = Rx buffer used slots
Those information can be obtained by OS_Si/SI_Enq too.
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)