Disassembly of RDOS for the Apple II
RDOS is a disk operating system developed by Roland Gustafsson. It was used by Strategic Simulations, Inc. (SSI) on dozens of their games. While more limited than DOS or ProDOS, it was fast and had a small memory footprint.
The earliest public version is RDOS 2.1, which uses the same low-level disk format as DOS 3.2. The successor, RDOS 3.3, uses the same 16-sector disk format as DOS 3.3. At least one updated version of RDOS 3.3 was published, but it did not alter the filesystem structure, and the version was still reported as "3.3" in the directory entry.
RDOS is copyright by Roland Gustafsson.
- Disassembly listing of RDOS 3.3.
- Project set - project files and binaries (requires SourceGen v1.9.0 or later).
- Disk image for an RDOS 3.3 utility disk (from Asimov).
Information about the structure of the RDOS filesystem can be found in the CiderPress II disk format documentation.
On a personal note, RDOS 2.1 was the first non-trivial program I ever made a full disassembly of. Back in 1987 this was done with fan-fold paper and colored highlighter pens. The act of doing so - and the desire for a tools that would make it easier - is a big part of what inspired SourceGen. The disassembly was used to develop ProDOS RDOS.
Using RDOS
RDOS 2.1 and 3.3 offer the same set of 17 commands. These are issued via the Applesoft BASIC ampersand vector.
- &C AT : prints the disk catalog. The code that does is loaded when needed from T1 S12 on an RDOS 2.1 disk, or T0 S1 of an RDOS 3.3 disk.
- &LOAD "filename" [,addr] : loads a BASIC program. You may specify a different load location for it (automates "poke 103,lo: poke 104,hi").
- &RUN "filename" [,addr] : loads and executes a BASIC program.
- &GOTO "filename" [,addr] : "chains" BASIC programs. Variables are saved, the new program is loaded, variables are restored, and the program is executed. The chain code is loaded when needed from T1 S11 of an RDOS 2.1 disk, or T0 S2 of an RDOS 3.3 disk.
- &SAVE "filename": saves the current BASIC program.
- &STORE "filename", addr, len : saves a binary file.
- &RECALL "filename" [,addr] : loads a binary file.
- &DEF "filename", size : creates a text file <size> blocks long (not bytes). Because RDOS files use a contiguous run of blocks, it is necessary to pre-allocate the file at creation time.
- &PRINT "filename" : writes a text file, starting from the beginning. This continues until &END is used, or the file fills up.
- &READ "filename": reads a text file. Reading past the end causes an error.
- &END : terminates reading or writing of text file by printing ASCII character $00 (nul).
- &DEL "filename": deletes a file.
- &LEN : prints the start location and size of the BASIC program in memory, and prints the current LOMEM value.
- &D#, [nxtcom] : changes the drive number (1-2). May be followed by another command (e.g. &D2, CAT); if not, the trailing comma must still be present.
- &S#, [nxtcom] : changes the slot number (1-7). Same notes as &D#.
- &NEW : erases the current program, resets himem, and coldstarts basic (like DOS 3.3 "FP" command).
- &USR addr : forwards unrecognized ampersand commands to the specified address. This provides a way to chain to other ampersand routines.
Because RDOS is tightly coupled to Applesoft BASIC, filenames, addresses, and slot/drive numbers can be variables. It is perfectly legal to write statements like:
150 &RECALL "SEGMENT" + STR$(SG) + "A", LOC + 5
Copyright 2024 by Andy McFadden