The extra facilities of the +3e operating system are provided as a set of calls known as IDEDOS. This document describes the various calls provided and how they can be accessed.
Before using any of the IDEDOS calls in your application, it is important to ensure that IDEDOS is present; if not, your application should report an error to the effect that it will only run on a +3e (v1.00 and above), and not a standard +3.
To check for IDEDOS, execute the standard +3DOS call DOS_VERSION and test the sign flag. If IDEDOS is present, the sign flag will be set.
Here's an example code fragment (don't forget that the memory configuration should be ROM2/5/2/7 when performing any +3DOS or IDEDOS call):
call DOS_VERSION jp m, gotide ...exit with IDEDOS not found error here...
IDEDOS calls are made in exactly the same way as standard +3DOS calls (as described in the +3 manual). A full description of each call is provided later. They may produce any standard +3DOS error code, and the following additional IDEDOS-specific errors:
IDEDOS will in fact never produce the rc_notimp error, but it is present so that your application can generate it if desired, and obtain a suitable error message from +3 BASIC. It is recommended that the rc_notimp error is generated if the version of IDEDOS is not high enough to provide a call or other functionality that you need.
To convert any +3DOS or IDEDOS error code into a +3 BASIC error code, and pass it to BASIC, use the following code:
cp $0a jr c,ricerr add a,$18 ; add $18 to most errors jr doerr .ricerr add a,$3d ; add $3d for Retry/Ignore/Cancel errors .doerr ld l,$cf ld h,a push hl ; places RST 8; DEFB err on stack ld hl,0 add hl,sp jp (hl) ; cause the error
Many calls are provided by IDEDOS, although most of these will not be of interest to the average application writer. A full description of every call available can be found here.
When writing your code, use the following definition file which contains all the call and error codes for ease of use:
To use this file, I recommend the excellent z80asm cross-compiler (follow link for details).
The calls are listed here by category, and all documentation refers to IDEDOS v1.00+, except where stated:
Useful calls that don't fit any other category.
NOTE: Swap partition calls should only be used on IDEDOS v1.06+. Previous versions contained bugs, so your application should check the version using IDE_VERSION before using these calls.
The most useful calls provided in IDEDOS v1.00 allow applications to access swap partitions in a very simple manner, providing them with a virtual memory system. Each application is advised to only open a single swap partition, as most users will not want to create more than 2 swap partitions (and the +3e uses one swap partition itself).
Applications can choose the size of the "blocks" of memory which the calls operate on; the size can be any multiple of 0.5K up to 32 (ie 16K). Blocks are numbered from 0 upwards, and if the end of the swap partition is reached, then wrapping occurs to block 0.
Access to data partitions is generally best left to +3DOS calls, as hard disk partitions created with the NEW DATA command can be accessed identically to any other +3DOS drive. However, it is possible to create and use partitions with a filesystem of your own devising, should you so desire (this is not for the faint-hearted!) using the following calls.
These calls, together with the data partition access calls above, allow partitions to managed, and might be useful in hard disk utility applications (for cloning or backing up partitions, for example).
These calls allow you to examine and alter the +3DOS drive mappings.
These calls provide a standard way for machine-code programs to access the Spectrum's streams and channels, sadly lacking from the standard machine. Note that for these calls only, the memory configuration should be ROM2/5/2/0, rather than the usual ROM2/5/2/7 for other IDEDOS calls, and the stack should be located in the normal position for BASIC (between STKEND and RAMTOP). Also, any errors will result in a standard 48K BASIC error being invoked (usually O - invalid stream or J - invalid I/O device).
These calls are for internal use only, and are listed here for completeness.
Please contact me if you would like any further information, or would like to port the IDEDOS part of the +3e operating system to another Spectrum setup or Z80-based computer.
Back to ZX Spectrum +3e homepage