h6. [[FileCore]] h6(. » [[FileCore SWI Calls|SWI Calls]] h6((. » [[FileCore_DiscOp]] h6(((. » Error Numbers h2. Error Numbers h4(#old). Old Style Error Codes. This whole scheme is predicated on addresses having their top bits clear. |_<^{width:4em}. Bit 31|_<^{width:4em}. Bit 30|_<^{width:4em}. Bit|_<^. Meaning| |/2<^. Clear|/2<^. Clear|<^. 0 - 7|<^. Error number| |<^. 8 – 29|<^. Clear| |/3<^. Set|/3<^. Clear|<^. 0 – 20|<^. Disc byte address / 256| |<^. 21 - 23|<^. Drive number| |<^. 24 – 29|<^. [[FileCore_DiscOp FS Specific Error Numbers|Disc error number]]| |<^. Clear|<^. Set|<^. |<^. R0 is an error pointer, (after bit 30 is cleared)| |/7<^. Set|/7<^. Set|<^. 0 – 29|<^. Pointer to a two-word block:| |<^. |<^. Offset +0:| |<^. 0 - 7|<^. [[FileCore_DiscOp FS Specific Error Numbers|Disc error number]]| |<^. 8 - 29|<^. Clear| |<^. |<^. Offset +4:| |<^. 0 - 28|<^. Disc sector number| |<^. 29 - 31|<^. Drive number| h4(#new). New Style Error Codes. For the new scheme, this is changed to use the least significant bits to distinguish the types: R0 < 256: R0 = [[FileCore_DiscOp FS Specific Error Numbers|disc error number]] Else: |_<^{width:4em}. Bit 1|_<^{width:4em}. Bit 0|_<^{width:4em}. Bit|_<^. Meaning| |<^. Clear|<^. Clear|<^. |<^. R0 is an error pointer| |/7<^. Clear|/7<^. Set|<^. |<^. R0 is an error pointer (once bit 0 is cleared); Points to a three word block:| |<^. |<^. Offset +0:| |<^. 0 - 7|<^. Drive number| |<^. 8 - 15|<^. [[FileCore_DiscOp FS Specific Error Numbers|Disc error number]]| |<^. 16 - 31|<^. Clear| |<^. |<^. Offset +4:| |<^. |<^. 64-bit bits address| |<^. Set|<^. Clear|<^. |<^. Reserved for future use| |<^. Set|<^. Set|<^. |<^. Reserved for future use| Clearly, this scheme is not compatible with the old-style error codes, but the two forms can easily be mechanically converted between. To use this error scheme, a FileCore module must set bit 10 in the [[FileCore FS Descriptor Block|descriptor block]] passed to [[FileCore_Create]]. However, if you wish your module to work with older versions of FileCore, you must return old-style errors when running with such a version. These versions can be distinguished by calling [[FileCore_Features]] after registering. If no error is returned, and bit 0 of R0 is on exit, you are running on a new FileCore, and should return the new error codes. Otherwise, you should return the old error codes - this can be easily be dealt with by using new-style errors throughout the core of your module, and putting a small conversion veneer on the error exit cases from your entry points. Note that the same error codes are used in the process error word of background transfer scatter lists; these should also use either the old or new scheme appropriately. If you are returning new-style errors, you must also store the most significant 30 bits of the block pointer in the background transfer process status word (i.e. bits 29-0 of process status correspond to bits 31-2 of the address of the scatter list entry corresponding to an error). h4. See also * [[FileCore]] * [[FileCore FS Descriptor Block]] * [[FileCore_Create]] * [[FileCore_DiscOp]] * [[FileCore_DiscOp FS Specific Error Numbers]]