ResiDOS Programming

ResiDOS provides an extremely comprehensive and powerful programming environment for the machine-code programmer. It is possible to write both application programs and "packages", which can extend the features of ResiDOS.

All calls are provided in a hardware-independent way and so can be used without knowing whether your application is running on a ZXCF, DividePlus or any other interface supported by ResiDOS. Additionally, file-system calls (which use the +3DOS and IDEDOS call interfaces also used in the ZX Spectrum +3, +2A/+2B and +3e) can be used to manipulate files on any filesystem (+3DOS, FAT etc) without the programmer needing to be aware of which filesystem is in use.


Code sample format

All the example pieces of code on these pages are provided in the format used by Interlogic's free z80asm assembler which is available for many platforms at Z88 Forever!. Binaries are provided for several platforms, and most others (including MacOS X) can compile the source package.

Whilst this assembler is slightly non-standard, it has a number of very useful features. It is also the assembler currently used by Z88DK , a C compiler which targets the Spectrum amongst many other Z80-based platforms.

You should download the following file, which contains various necessary include files for programming in ResiDOS, together with an example utility program (assembly file and pre-built TAP/TZX):


General Information

The following links provide further information on how to program for ResiDOS:


Call References

The following links provide call references for the facilities available to machine-code programs from various packages.

You should ensure that the version of the package installed is high enough to support the calls you wish to make.


Command/Function References

These pages document the command and function handlers for BASIC commands/functions provided by various packages. These handlers can be invoked by the RESI_COMMAND package call, in order to be able to execute BASIC commands directly from a machine-code program (or package). A separate include file which contains the definitions for each package can be found in resitools.zip.

Parameters provided to commands are normally stored in the 32-byte parameter block, pointed to by IX. The types of parameters used by commands in this block are as follows:

Floating-point parameters are stored on the BASIC floating-point stack. For functions, all input parameters must be stored on the BASIC floating-point stack, with the last parameter on the top of the stack.

Additionally, commands have an 8-bit option flags byte stored at (IY+0), the system variable ERR_NR.


Back to the ResiDOS home page