The following is a complete list of calls provided with IDEDOS v1.03 (and above). Some calls were not available in earlier versions (or behaved slightly differently) and are marked as such.

IN: -
OUT: D=version, E=sub-version
Fc=1, success
Register status on return:
A.BC..HL/IX same
.F..DE../.. different
Returns IDEDOS version information.

IN: -
OUT: A=number of drives detected (0 to 2)
Register status on return:
......../IX same
AFBCDEHL/.. different
Initialises the IDE interface and detects the number of drives.
This call is for internal use only, and results are only valid when it is the first IDE call made after a reset.
Instead of using this call, applications should use the IDE_DRIVE call to detect whether a particular unit is present.

IN: -
OUT: Fc=1, success
Register status on return:
......../IX same
AFBCDEHL/.. different
Initialises IDEDOS.
This call is for internal use only.

IN: A=unit (0 or 1)
OUT(s): Fc=1
IX=address of unit information
OUT(f): Fc=0, A=error code
Register status on return:
..BCDEHL/.. same
AF....../IX different
Returns address of IDE unit information. Can be used to detect if a unit is present or not (by success or failure of this call).

IN: IX=partition handle
B=page for transfer
HL=address
CDE=logical 512-byte sector number
OUT(s): Fc=1
HL=end address+1 (in segment 3, for +3e)
OUT(f): Fc=0, A=error code
Register status on return:
..BC..../IX same
AF..DEHL/.. different
Low-level sector read.

IN: IX=partition handle
B=page for transfer
HL=address
CDE=logical 512-byte sector number
OUT(s): Fc=1
HL=end address+1 (in segment 3, for +3e)
OUT(f): Fc=0, A=error code
Register status on return:
..BC..../IX same
AF..DEHL/.. different
Low-level sector write.

IN: A=unit (0 or 1)
BC=max partition number to allow (must be >2)
IX=cylinders
H=heads (v1.03+: bit 7=enable disk sharing mode)
L=sectors per track
OUT(s): Fc=1
OUT(f): Fc=0, A=error
Register status on return:
......../.. same
AFBCDEHL/IX different
Formats an IDE drive.
From v1.03 onwards, if bit 7 of H is set, then IDEDOS starts at cylinder 0, head 1, sector 1. This leaves the boot sector intact, allowing the drive to be shared with PC partitioning schemes.

IN: A=unit (0 or 1)
HL=addr of name of partition to find (16 bytes, padded with spaces)
OUT(s): Fc=1
BC=partition number
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Returns the partition number for the partition name supplied at HL. The search is not case-sensitive, and takes place only on the specified IDE unit.

IN: A=unit (0 or 1)
HL=address of 64-byte partition entry
OUT(s): Fc=1
BC=partition number
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Creates a new partition on the specified IDE drive. The partition entry passed to this routine must have the name, type and largest logical sector number filled in. Optionally, the type-specific information may be filled in. On exit, the system information will have been updated.

IN: A=unit (0 or 1)
BC=partition number
L=fill byte
IX=max logical sector to initialise (0=all)
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Initialises sectors in the specified partition. Logical 512-byte sectors from 0 to IX are filled with the byte value in L. If IX=0, the entire partition is initialised.
NOTE: This call only works correctly for partitions up to 16Gb in size.

IN: A=unit (0 or 1)
BC=partition number
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Deletes the partition specified.

IN: A=unit (0 or 1)
BC=partition number
HL=addr of new name (16 bytes, padded with spaces)
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Renames the partition specified.

IN: A=unit (0 or 1)
BC=partition number
HL=address to store partition entry
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
..BC..../IX same
AF..DEHL/.. different
Reads a 64-byte partition entry.

IN: A=unit (0 or 1)
BC=partition number
HL=address of partition entry
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
..BC..../IX same
AF..DEHL/.. different
Writes a 64-byte partition entry.
This call is for internal use only. Applications should use the IDE_PARTITION_WINFO, IDE_PARTITION_SETINFO and IDE_PARTITION_RENAME calls instead.

IN: A=unit (0 or 1)
BC=partition number
HL=address of 32-byte type-specific partition information
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Updates the 32-byte type-specific information of the specified partition. The IDE_PARTITION_SETINFO call is recommended instead of this one.

IN: A=unit (0 or 1)
BC=partition number
OUT(s): Fc=1
IX=partition handle
OUT(f): Fc=0, A=error code
Register status on return:
......../.. same
AFBCDEHL/IX different
Opens the partition specified, returning the handle in IX.

IN: IX=partition handle
OUT(s): Fc=1
Register status on return:
..BCDEHL/.. same
AF....../IX different
Closes the partition referred to by IX.
NOTE: Applications/operating systems must ensure that no files remain open on the partition before closing it.

IN: A=unit (0 or 1)
BC=partition number
L=offset of byte to return (0..31) in type-specific info
OUT(s): Fc=1
A=byte value
Fz=1 if A=0, otherwise Fz=0
OUT(f): Fc=0, A=error code
Register status on return:
..BC..../IX same
AF..DEHL/.. different
Reads the specified byte in the type-specific information section of the partition.

IN: A=unit (0 or 1)
BC=partition number
L=offset of byte to set (0..31) in type-specific info
H=byte value
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
..BC..../IX same
AF..DEHL/.. different
Writes the specified byte into the type-specific information of the partition.

IN: A=block size in sectors, 1 (0.5K) to 32 (16K)
BC=max block number required
OUT(s): Fc=1
IX=swap handle
OUT(f): Fc=0, A=error code
Register status on return:
......../.. same
AFBCDEHL/IX different
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 this call.
Locates a suitable free swap partition and opens it, returning the handle in IX. The block size specified (any multiple of 0.5K up to 16K) determines the amount of data that is swapped in and out with the other IDE_SWAP_ calls. The size of the swap partition required is calculated as (blocksize)* (max block number+1). The current block number is set to 0.

IN: IX=swap handle
OUT(s): Fc=1
Register status on return:
..BCDEHL/.. same
AF....../IX different
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 this call.
Closes the swap partition specified.

IN: IX=swap handle
B=page
HL=address
OUT(s): Fc=1
HL=end address+1
OUT(f): Fc=0, A=error code
Register status on return:
..B...../IX same
AF.CDEHL/.. different
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 this call.
Writes a block of memory at BHL to the current block in the swap partition, and increments the block number (wrapping to block 0 if the end of the swap partition is encountered).

IN: IX=swap handle
B=page
HL=address
OUT(s): Fc=1
HL=end address+1
OUT(f): Fc=0, A=error code
Register status on return:
..B...../IX same
AF.CDEHL/.. different
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 this call.
Reads a block of memory from the current block in the swap partition, and increments the block number (wrapping to block 0 if the end of the swap partition is encountered).

IN: IX=swap handle
B=page
HL=address
OUT(s): Fc=1
HL=end address+1
OUT(f): Fc=0, A=error code
Register status on return:
..B...../IX same
AF.CDEHL/.. different
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 this call.
Exchanges a block of memory with the current block in the swap partition, and increments the block number (wrapping to block 0 if the end of the swap partition is encountered).

IN: IX=swap handle
OUT(s): Fc=1
BC=block number
OUT(f): Fc=0, A=error code
Register status on return:
....DEHL/IX same
AFBC..../.. different
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 this call.
Returns the number of the current block in the swap partition.

IN: IX=swap handle
BC=block number
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
..BCDEHL/IX same
AF....../.. different
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 this call.
Sets the current block number in the swap partition.

IN: IX=swap handle
A=new block size in sectors 1 (0.5K) to 32 (16K)
BC=max block number required
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
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 this call.
Changes the block size of the currently open swap partition specified. You must specify the largest block number of the new size required; if this is out of range, an error will occur and the swap partition will be unchanged. If successful, the current block number will be reset to 0.

IN: A=unit (0 or 1), or physical device:
2=floppy device 0
3=floppy device 1
4=RAMdisk
BC=partition number
For +3e:
L=drive letter 'A' to 'P' (uppercase)
If bit 6 of FLAGS3 is set, this mapping will become permanent,
and take effect at boot
For ResiDOS:
L=drive letter 'A' to 'P', or 'a' to 'p'
If the drive letter is lowercase, this mapping will become permanent,
and take effect at boot
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Maps a +3DOS drive to the specified partition or physical device (doing this causes the partition to be opened for that drive).

IN: For +3e:
L=drive letter 'A' to 'P' (uppercase)
If bit 6 of FLAGS3 is set, any permanent mapping to this drive
letter will also be removed
For ResiDOS:
L=drive letter 'A' to 'P', or 'a' to 'p'
If the drive letter is lowercase, any permanent mapping to this
drive letter will also be removed
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Removes the mapping from the specified drive (closing any partition as necessary).

IN: L=drive letter 'A' to 'P' (uppercase)
BC=address of 18-byte buffer
OUT(s): Fc=1
Fz=1 if not mapped (and other info not valid)
Fz=0, mapping is as follows:
A=unit (0 or 1), or physical device:
2=floppy device 0
3=floppy device 1
4=RAMdisk
BC=partition number (if hard disk)
buffer contains text description, or blanked if no mapping
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Returns details of the current mapping of the specified drive letter.

IN: L=drive letter 'A' to 'P' (uppercase)
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../IX same
AFBCDEHL/.. different
Removes any permanent mapping for the specified drive letter.

IN: HL=filespec, terminated with $ff
BC=routine address (0=place routine on stack)
OUT(s): Does not return if successful
OUT(f): Fc=0, A=error code
Register status on return:
......../.. same
AFBCDEHL/IX different
Loads and runs a Z80 snapshot file.

IN: A=stream number
DE=address of string specifying channel to open
BC=length of string specifying channel to open
OUT(s): Fc=1
OUT(f): Fc=0
A=+3 BASIC error code: $17=invalid stream, $0e=invalid filename
Register status on return:
......../.. same
AFBCDEHL/IX different
NOTE: This call must be made with the ROM2/5/2/0 memory configuration, not the normal DOS configuration. The stack must be located between STKEND and RAMTOP (the normal position for +3 BASIC). The error codes returned are +3 BASIC codes, not +3DOS errors.
Opens stream A to the channel specified by the string at DE, length BC. The string provided can be anything accepted by the BASIC OPEN # command.
On ResiDOS, this call is not implemented and returns an error. Use RESI_STREAM_OPEN instead.

IN: A=stream number
OUT(s): Fc=1
OUT(f): Fc=0
A=+3 BASIC error code: $17=invalid stream, $12=invalid I/O device
Register status on return:
......../.. same
AFBCDEHL/IX different
NOTE: This call must be made with the ROM2/5/2/0 memory configuration, not the normal DOS configuration. The stack must be located between STKEND and RAMTOP (the normal position for +3 BASIC). The error codes returned are +3 BASIC codes, not +3DOS errors.
Closes the channel attached to stream A. If A is one of the standard streams 0..3, then the default channel is re-attached to it after closing.
On ResiDOS, this call is not implemented and returns an error. Use RESI_STREAM_CLOSE instead.

IN: required stream has been made current via $1601 in ROM 3
OUT(s): A=byte
OUT(f): does not return, +3 BASIC error is caused
Register status on return:
......../.. same
AFBCDEHL/IX different
NOTE: This call must be made with the ROM2/5/2/0 memory configuration, not the normal DOS configuration. The stack must be located between STKEND and RAMTOP (the normal position for +3 BASIC). Any errors result in a +3 BASIC error being invoked, and no return is made to the caller. Before calling this routine, the desired stream must be made current by calling routine $1601 in ROM 3 with A=stream number.
Gets the next input character from the current stream.
On ResiDOS, this call is not implemented and returns an error. Use RESI_STREAM_IN instead.

IN: required stream has been made current via $1601 in ROM 3
C=byte
OUT(s): -
OUT(f): does not return, +3 BASIC error is caused
Register status on return:
......../.. same
AFBCDEHL/IX different
NOTE: This call must be made with the ROM2/5/2/0 memory configuration, not the normal DOS configuration. The stack must be located between STKEND and RAMTOP (the normal position for +3 BASIC). Any errors result in a +3 BASIC error being invoked, and no return is made to the caller. Before calling this routine, the desired stream must be made current by calling routine $1601 in ROM 3 with A=stream number.
Outputs a character to the current stream.
On ResiDOS, this call is not implemented and returns an error. Use RESI_STREAM_OUT instead.

IN: required stream has been made current via $1601 in ROM 3
B=reason code:
0=get stream pointer
1=set stream pointer
2=get stream extent
DEHL=pointer, for B=1 only
OUT(s): DEHL=pointer, for B=0 only
DEHL=extent, for B=2 only
OUT(f): does not return, +3 BASIC error is caused
Register status on return:
......../.. same
AFBCDEHL/IX different
NOTE: This call must be made with the ROM2/5/2/0 memory configuration, not the normal DOS configuration. The stack must be located between STKEND and RAMTOP (the normal position for +3 BASIC). Any errors result in a +3 BASIC error being invoked, and no return is made to the caller. Before calling this routine, the desired stream must be made current by calling routine $1601 in ROM 3 with A=stream number.
Sets or gets the requested pointer or extent associated with the current stream. This operation is only supported on some extended channels.
On ResiDOS, this call is not implemented and returns an error. Use RESI_STREAM_PTR instead.

Requires IDEDOS v1.01+
IN: HL=source address
DE=destination address
BC=length
OUT(s): Fc=1 (always succeeds on ResiDOS)
OUT(f): Fc=0, A=error code (rc_notimp on +3e)
Register status on return:
......../IX same
AFBCDEHL/.. different
This call is provided so that data which exists in the ResiDOS memory can be read or written by programs. Such addresses are referred to in the +3DOS documentation as being "in page 7". Instead, use this call, with the provided address as the source or destination, and your own buffer as the other address.
On the +3e, this call is not implemented and returns an error.

Requires IDEDOS v1.02+
IN: B=page for transfer
C=unit (0 or 1)
HL=address of 512-byte buffer
OUT(s): Fc=1
HL=end address+1 (in segment 3, for +3e)
OUT(f): Fc=0, A=error code
Register status on return:
..BCDE../IX same
AF....HL/.. different
Reads the 512-byte drive identity information, which can be examined to determine the drive type and manufacturer, as well as other information.
If an 8-bit interface is being used, then a successful call results in an error code of Fc=0, A=rc_8bitdata. This signifies that the first 256 bytes of the buffer contain the low bytes of each of the 256 words of the drive identity information. The high bytes are not available, except for the high byte of word 1 (number of cylinders in the default CHS translation), which is stored at byte 256. Bytes 257-511 are not valid for 8-bit interfaces.

Requires IDEDOS v1.02+
IN: A=unit (0 or 1)
OUT(s): A=number of open partitions, excluding system
HL=free partition handle, or 0
Fc=1
Register status on return:
......../.. same
AFBCDEHL/IX different
Returns the number of open partitions (excluding the system partition, which is always open) on the unit specified.

Requires IDEDOS v1.05+
IN: A=reason code, fs_request (0) or fs_release (1)
B=package ID
C=unit (0..15)
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
....DE../IX same
AFBC..HL/.. different
This call is exclusively for the use of ResiDOS packages which implement filesystems. Such a package can request a unit for which it will then take responsibility in subsequent IDEDOS and +3DOS calls. This is usually done at initialisation time, and a package should search through unit IDs using this call until it obtains a free one.
On the +3e, this call is not implemented and returns an error.

Requires IDEDOS v1.05+
IN: A=reason code, fs_request (0) or fs_release (1)
B=package ID
C=drive (0..15, where 0==A..15==P)
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
....DE../IX same
AFBC..HL/.. different
This call is exclusively for the use of ResiDOS packages which implement filesystems. Such a package can request or release a drive for which it will then take responsibility in subsequent IDEDOS and +3DOS calls. This is usually done in response to an IDE_DOS_MAP or IDE_DOS_UNMAP call received by the package.
On the +3e, this call is not implemented and returns an error.

Requires IDEDOS v1.05+
IN: A=reason code, fs_request (0)
fs_release (1)
fs_gethead (2)
fs_puthead (3)
B=package ID
C=filehandle (0..15)
For fs_puthead:
E,D,L,H,IXl,IXh,IYl,IYh=8-byte header information
OUT(s): Fc=1
For fs_gethead:
E,D,L,H,IXl,IXh,IYl,IYh=8-byte header information
OUT(f): Fc=0, A=error code
Register status on return (for fs_request or fs_release):
....DE../IX same
AFBC..HL/.. different
Register status on return (for fs_gethead or fs_puthead):
......../.... same
AFBCDEHL/IXIY different
This call is exclusively for the use of ResiDOS packages which implement filesystems. Such a package can request or release a filehandle for which it will then take responsibility in subsequent IDEDOS and +3DOS calls. This is usually done in response to an IDE_DOS_OPEN, IDE_DOS_CLOSE or IDE_DOS_ABANDON call received by the package.
Additionally, the fs_gethead and fs_puthead reasons are used to keep the 8-byte file header information synchronised between the filesystem package and the IDEDOS package (which allows external access to this information via the DOS_REF_HEAD and IDE_ACCESS_DATA calls). Packages should use fs_gethead to obtain the header information before writing a file header to disk, and use fs_puthead to set the header information directly after reading a file header from disk.
On the +3e, this call is not implemented and returns an error.

Requires IDEDOS v1.05+
IN: A=reason code,
rc_path_change (0),
rc_path_get (1),
rc_path_make (2),
rc_path_delete (3)
HL=address of pathspec (terminated with $ff)
NB: For rc_path_get, this must also be a 256-buffer
for the returned result
OUT(s): Fc=1
OUT(f): Fc=0, A=error code
Register status on return:
......../.... same
AFBCDEHL/IXIY different
This call allows the current directory or path for a particular drive (and user area) to be changed or obtained. It also allows creation and deletion of directories.
For rc_path_change, rc_path_make and rc_path_delete, HL points to a directory specification, terminated by $ff. This may optionally include a drive letter, user area and full path (if not, the current default values are used). For rc_path_change, the current path on that drive is changed to the directory or path specified. For rc_path_make and rc_path_delete, the named directory is created or deleted.
For rc_path_get, HL points to a location specification (ie a drive and/or user area, terminated with a colon and $ff). The current path for that location will then be written to the buffer at HL and terminated with $ff.
Note that this call will return an error of rc_notimp if the drive on which it is operating is formatted with a filesystem that does not support directories (eg a +3DOS drive).
On the +3e, this call is not implemented and returns an error.
