Z88 Developers' Notes | ||
---|---|---|
Contents | Contents of System Calls |
OS_Dor, the DOR interface
RST 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 recordOUT, if call successful:
Fc = 0 returned values depend on A(in)OUT, if call failed:
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 fileRegisters changed after return:
not documented.Notes:
When the last DOR record in a list has been read, an RC_EOF is reported and the handle is immediatly released, ie. it will not be necessary to release the handle with a DR_FRE call.Bugs:
Corrupts the stack pointer SP when called with an old handle, e.g. when a previous DR_ call resulted in a "End of list" error (RC_EOF).Reason code specifications:
DR_GET ($01), get a handle for a DOR name (internal usage)
IN:
HL = pointer to a string (full path with device name)OUT, if call successful:
Fc = 0 IX = DOR handle A = minor typeRegisters changed after return:
..BCDEHL/..IY same AF....../IX.. differentNotes:
Do not use this call. Instead use GN_Opf with A = OP_DOR to obtain a DOR handle.DR_DUP ($02), duplicate DOR
IN:
IX = DOR handleOUT, if call successful:
Fc = 0 BC = duplicate DOR handle (IX is still valid)OUT, if call failed:
Fc = 1 BC = 0 (IX is still valid) A = error code RC_HAND ($08), bad DOR handleRegisters changed after return:
....DEHL/IXIY same AFBC..../.... differentDR_SIB ($03), return brother DOR
IN:
IX = DOR handleOUT, if call successful:
Fc = 0 IX = next DOR handle (original IX invalid) A = minor typeOUT, if call failed:
Fc = 1 A = error code RC_HAND ($08), bad DOR handleRegisters changed after return:
..BCDEHL/..IY same AF....../IX.. differentDR_SON ($04), return child DOR
IN:
IX = DOR handleOUT, if call successful:
Fc = 0 IX = child DOR handle (original IX invalid) A = minor typeOUT, if call failed:
Fc = 1 A = error code RC_HAND ($08), bad DOR handleRegisters changed after return:
..BCDEHL/..IY same AF....../IX.. differentDR_FRE ($05), free DOR handle
IN:
IX = DOR handleOUT, if call successful:
Fc = 0 IX = 0OUT, if call failed:
Fc = 1 A = error code RC_HAND ($08), bad DOR handleRegisters changed after return:
..BCDEHL/..IY same AF....../IX.. differentDR_CRE ($06), create blank DOR
IN:
IX = parent DOR handle B = minor typeOUT, if call successful:
Fc = 0 IX = new DOR handle (original IX invalid)OUT, if call failed:
Fc = 1 A = error code RC_HAND ($08), bad DOR handle RC_BAD ($04), bad argument RC_ROOM ($07), no roomRegisters changed after return:
..BCDEHL/..IY same AF....../IX.. differentDR_DEL ($07), delete DOR
IN:
IX = DOR handleOUT, if call successful:
Fc = 0, DOR deleted IX = 0OUT, if call failed:
Fc = 1 A = error code RC_HAND ($08), bad DOR handleRegisters changed after return:
..BCDEHL/..IY same AF....../IX.. differentDR_INS ($08), insert DOR
IN:
BC = parent DOR handle IX = DOR handleOUT, if call successful:
Fc = 0 original BC and IX DOR handles are still validOUT, if call failed:
Fc = 1 BC and IX is still valid A = error code RC_HAND ($08), bad DOR handleRegisters changed after return:
..BCDEHL/IXIY same AF....../.... differentDR_RD ($09), read DOR record
IN:
B = record type C = buffer length DE = user buffer address (to store information of read) IX = DOR handleOUT, if call successful:
Fc = 0 original IX DOR handle is still valid C = actual length of informationOUT, if call failed:
Fc = 1 original IX is still valid A = error code RC_HAND ($08), bad DOR handle RC_BAD ($04), bad argument RC_FAIL ($16), information is not presentRegisters changed after return:
..B.DEHL/IXIY same AF.C..../.... differentDR_WR ($0A), write DOR record
IN:
B = record type C = buffer length DE = user buffer address (to copy information of store) IX = DOR handleOUT, if call successful:
Fc = 0 original IX DOR handle is still validOUT, if call failed:
Fc = 1 original IX is still valid A = error code RC_HAND ($08), bad DOR handle RC_BAD ($04), bad argumentRegisters changed after return:
..BCDEHL/IXIY same AF....../.... different