Rom Filing System — User Manual

RFS User Manual

The Rom Filing System (RFS) is a Z80 assembly language firmware package that turns a Sharp MZ-80A (and compatible hardware) into a modern-feeling retro computer. It replaces the original Monitor and User ROM with an expanded firmware that adds an SD card filing system, CP/M 2.2 boot, multiple BASIC interpreters, a built-in Z80 assembler and disassembler, and more than 30 new monitor commands — all while keeping the familiar SA-1510 * prompt and every original command intact.
This manual covers everything needed to install and use RFS day-to-day. For hardware architecture and build system details see the Technical Guide. For source code internals and firmware development see the Developer's Guide.

Supported Hardware

RFS supports four hardware platforms, each selected at compile time. The resulting ROM images and feature set differ slightly between targets:
Platform Description Key Features
RomDisk card Original RFS target. A PCB that plugs into the MZ-80A expansion and replaces the Monitor and User ROM sockets with up to 4×512 KB Flash RAM, 512 KB SRAM, and an SDXC card reader. Full feature set: SD card, all monitor commands, CP/M, BASIC variants, tape operations
SFD-700 The SFD-700 mkII floppy disk interface card. RFS occupies the card’s Flash ROM space. Floppy boot, ROM-based programs, inline Z80 assembler/disassembler; no SD card commands
picoZ80 The RP2350-based Z80 replacement board. RFS runs within its emulated ROM space. Full feature set equivalent to RomDisk
tranZPUter FusionX FPGA-based Z80 enhancement board. RFS runs within its Flash ROM space. Full feature set
Commands marked (R) in the monitor command reference below are present only in the RomDisk / picoZ80 build. Commands marked (S) are present only in the SFD-700 build.

Getting RFS

Pre-built ROM images and SD card images are available in the releases/ directory of the GitHub repository. These can be programmed directly without any build tools. If you want to build from source, see the Technical Guide — Build System.
For the RomDisk and picoZ80 builds the following files are needed:
  • MROM_ROMDISK_256.bin or MROM_PICOZ80_256.bin — Monitor ROM image (program into the Monitor ROM Flash chip).
  • USER_ROM_256.bin, USER_ROM_II_256.bin, USER_ROM_III_256.bin — User ROM images (program into User ROM Flash chips 1–3).
  • SHARP_MZ80A_RFS_CPM_IMAGE_1.img — SD card image (write to a micro/standard SD card with dd).
For the SFD-700 build:
  • SFD700_256.bin — Combined SFD-700 ROM image (program into the SFD-700 mkII Flash ROM).

Programming the Flash ROMs
ROM images are written to SST39SF040 (512 KB) Flash chips using a TL866 II+ or compatible programmer with the minipro utility:
# Monitor ROM (RomDisk build):
minipro --infoic /path/to/minipro/infoic.xml -p SST39SF040 -s -w roms/MROM_ROMDISK_256.bin

# User ROM 1:
minipro --infoic /path/to/minipro/infoic.xml -p SST39SF040 -s -w roms/USER_ROM_256.bin

# SFD-700:
minipro --infoic /path/to/minipro/infoic.xml -p SST39SF040 -s -w roms/SFD700_256.bin

Writing the SD Card
Write the combined SD card image directly to the card using dd on Linux. No partitioning is required — the SDCFS image starts at sector 0:
# Replace /dev/sdX with your SD card device node:
dd if=roms/SHARP_MZ80A_RFS_CPM_IMAGE_1.img of=/dev/sdX bs=512
sync

First Boot

After inserting the programmed ROM chips and (for RomDisk) the SD card, power on the Sharp MZ-80A. The familiar SA-1510 sign-on banner will appear. When RFS has initialised the SD card filing system successfully, the banner is appended with "+ RFS":
SHARP MZ-80A
Monitor SA-1510  + RFS

*
The * is the monitor prompt. All original SA-1510 commands are available unchanged. Type H to display a paginated help screen listing all RFS commands. Press Space to advance through pages.
If the + RFS text is absent, the SD card was not detected — check the card is correctly inserted, formatted, and contains the SDCFS image at sector 0.

Monitor Command Reference

The full RFS command set is listed below. Commands carry (R) if they are present only in the RomDisk / picoZ80 build; (S) if only in the SFD-700 build. All other commands are available in every build.
Command Parameters Description
0 .. 9 (R) Select the active RFS SD card drive (0–9). The selected drive number is shown in the prompt.
40 (R) Switch to 40-column display mode (requires Kuma 40/80 upgrade or Video Module).
80 (R) Switch to 80-column display mode (requires Kuma 40/80 upgrade or Video Module).
ASM (S) <address> Interactive Z80 assembler. Enter assembly mnemonics directly into memory starting at the given hex address. Press Enter on a blank line to exit.
B Toggle the keyboard bell on or off.
BASIC Locate Sharp BASIC SA-5510RFS on the active SD drive or ROM, load and execute it.
C [<byte>] Clear (initialise) memory from 0x1200 to top of RAM with 0x00 or the supplied 8-bit hex value.
CP <src> <dst> <size> Copy a block of memory. All arguments are 4-digit hex: source address, destination address, byte count.
CPM Locate CP/M 2.2 on the active SD drive or ROM, load and boot it.
D <addr> [<addr2>] Hex and ASCII dump of memory from <addr> to <addr2> (or 20 lines if no end address). Press any key for more, U to page up, X to exit. Repeat D without an address to continue from the last position.
DASM (S) <addr> [<addr2>] Disassemble Z80 machine code starting at <addr>.
EC (R) <name> or <file#> Erase a file from the active SD card drive by name or file number.
F [<drive>] Boot from the specified floppy drive number. If omitted, you are prompted to enter a drive number.
f Execute the original floppy AFI boot code at 0xF000.
H Display the command help screen (paginated; press Space to advance).
IC (R) Paged directory listing of files on the active SD card drive. Shows file number and filename.
IR Paged directory listing of programs stored in the Flash ROM drives.
J <address> Jump to (execute from) the given hex address.
L / LT [<filename>] Load a file from tape (CMT) and execute it.
LTNX [<filename>] Load a file from tape (CMT) without executing.
LR <name> or <file#> Load a program from ROM by name or file number and execute it.
LRNX <name> or <file#> Load a program from ROM by name or file number without executing.
LC (R) <name> or <file#> Load a program from the active SD card drive and execute it.
LCNX (R) <name> or <file#> Load a program from the active SD card drive without executing.
M <address> Interactive memory editor. Displays current byte value; type a new hex value and press Enter, or Enter alone to skip. Press X to exit.
P Run a test on the connected printer.
R Run a DRAM memory test.
S / ST <start> <end> <exec> Save a memory range to tape (CMT). You are prompted for a filename. Example: S120020001203 saves 0x1200–0x2000, execution address 0x1203.
SC (R) <start> <end> <exec> Save a memory range to the active SD card drive. You are prompted for a filename.
SD2T (R) <name> or <file#> Copy a file from the active SD card drive to tape (CMT).
T Test the 8253 timer chip.
T2SD (R) Load a program from tape (CMT) and write it to the active SD card drive.
V Verify a tape save against the data currently in memory.
X (R) Exchange to the hi-load ROM variant so DRAM spans 0x0000–0xCFFF.

Using the SD Card Drives

RFS provides ten logical drives (0–9) stored sequentially on the SD card. Each drive holds up to 256 files of up to 64 KB each. The currently active drive is shown in the monitor prompt — type a single digit (0–9) to switch drives.

Viewing the Directory
Type IC to list the files on the active SD drive. Each entry shows a two-digit hex file number followed by the filename. In 80-column mode, four columns are shown simultaneously.
* IC

00 INVADERS     01 DEFENDER     02 GALAXIANS    03 SPACE ATTACK
04 PACMAN       05 SNAKE        ...
Press SPACE to continue, X to exit
Type IR to list programs stored in the Flash ROM drives. These are read-only and available regardless of whether an SD card is inserted.

Loading Programs
Programs can be loaded by name or by file number. Loading by number is faster as no string matching is required:
* LC INVADERS       ; Load INVADERS from the active SD drive and execute
* LCNX INVADERS     ; Load without executing (useful for debugging)
* LC 04             ; Load file number 04 from the active SD drive
* LR SA-5510RFS     ; Load SA-5510RFS from the ROM drive and execute

Saving Programs
Use SC to save a memory range to the active SD card drive. The syntax is identical to the tape S command — start address, end address, and execution address as 4-digit hex values run together, then you are prompted for a filename:
* SC120020001200
FILE NAME? MYPROG
SAVED

Tape ↔ SD Card Transfer
Files can be copied between tape (CMT) and the SD card in either direction:
  • T2SD — loads the next file from tape and saves it to the active SD card drive. You will be prompted to press Play on the tape deck before the load begins.
  • SD2T <name> — loads the named file from the active SD card drive and writes it to tape exactly as if it were a tape-to-tape copy. Press Record on the tape deck when prompted.
This makes it straightforward to archive existing tape software to SD card or to distribute software on tape from the SD card collection.

Using BASIC

Sharp SA-5510RFS BASIC
The original Sharp SA-5510 BASIC interpreter has been extended with RFS-aware LOAD, SAVE, and DIR commands. It is stored in the ROM drive as SA-5510RFS. Start it with:
* BASIC
Once in BASIC, the following extended commands are available:
Command Example Description
LOAD LOAD "TEST" Load program named TEST from the active drive and run it.
LOAD LOAD "3:TEST" Load TEST from RFS drive 3, making drive 3 active.
LOAD LOAD "C:TEST" Load TEST from the internal cassette (CMT).
LOAD LOAD Load the next sequential file from the active drive.
SAVE SAVE "TEST" Overwrite an existing file named TEST on the active drive, or create it.
SAVE SAVE "3:TEST" Save to RFS drive 3 and make drive 3 active.
SAVE SAVE "C:TEST" Save to CMT with the name TEST.
DIR DIR List the SD card directory for the active drive.
DIR DIR "3:" List drive 3 and make it active.

Microsoft BASIC
Microsoft BASIC (based on NASCOM BASIC v4.7b) is included in three variants:
  • MS-BASIC(MZ-80A) — standard MZ-80A hardware, cassette storage only.
  • MS-BASIC(RFS40) — RFS with 40-column display; adds SD card CLOAD, CSAVE, DIR commands.
  • MS-BASIC(RFS80) — RFS with 80-column display; adds SD card CLOAD, CSAVE, DIR commands.
Load the appropriate variant from the ROM drive:
* LR MS-BASIC(RFS40)
The RFS extensions in MS-BASIC work similarly to SA-5510RFS — the drive qualifier prefix selects an RFS drive number before the filename:
CLOAD "8:STARTREK"    ; Load STARTREK from RFS drive 8
CSAVE "8:MYPROG"      ; Save to RFS drive 8
DIR "5:"              ; List drive 5
The ANSITERM command enables or disables the built-in ANSI terminal processor (on by default). This allows BASIC programs that use ANSI escape sequences for cursor positioning and colours to run unchanged:
ANSITERM 0    ; Disable ANSI processing
ANSITERM 1    ; Enable ANSI processing (default)

Converting NASCOM Cassette Programs
NASCOM BASIC programs distributed as cassette image files (.cas) can be converted for use on the MZ-80A with the bundled nasconv tool. It strips tape framing data and remaps token values to match the RFS MS-BASIC extension:
nasconv --image startrek.cas --output startrek.bas \
        --nasaddr 0x10fa --loadaddr 0x4341

Running CP/M 2.2

CP/M 2.2 is available on all RFS platforms. From the monitor prompt:
* CPM
RFS will locate CP/M on the active SD card drive or ROM, load it, and transfer control to the CP/M CCP. The prompt changes to A>.
CP/M provides 47 KB of program RAM. The CBIOS lives entirely in ROM, leaving all 47 KB free for applications. Up to seven CP/M disk drives (A:–G:) are available depending on the hardware:
CP/M Drive Contents
A: SD card — CP/M system programs, Turbo Pascal, Hi-Soft C, etc.
B: SD card — Pascal utilities and Pascal User Group disks
C: SD card — PLI, PLM, WordStar
D:–G: SD card — Grant Searle CP/M collection (C0–F9)
The built-in ANSI terminal emulator maps standard ANSI escape sequences to the MZ-80A screen, making most CP/M applications that rely on screen control work correctly without modification. The keyboard includes auto-repeat and proper mapping of all MZ-80A keys to ASCII.
To return to the RFS monitor from CP/M, use a warm boot (Ctrl+C from the CCP) which reloads the CCP. A full exit back to the SA-1510 monitor requires a hardware reset.

Display Modes

If a Kuma 40/80 column upgrade or the 40/80 colour Video Module is fitted to the MZ-80A, RFS can switch between 40 and 80 column display modes at the monitor prompt:
* 40       ; Switch to 40-column display
* 80       ; Switch to 80-column display
In 80-column mode the IC and IR directory commands display four columns, making it much faster to find programs by eye. The MS-BASIC(RFS80) variant is built specifically for 80-column use, with all screen output assuming 80 columns.
Without the 40/80 upgrade, the RFS firmware still boots and operates normally — these commands are simply unavailable.

SD Card Organisation

The pre-built SD card image organises programs into ten RFS drives and seven CP/M disk images:
RFS Drive Contents
0 Common and MZ-80A machine code programs
1 MZ-80K machine code programs
2 MZ-700 machine code programs
3 MZ-800 / MZ-1500 machine code programs
4 MZ-80B / MZ-2000 machine code programs
5 BASIC programs, type 2 (MZ-80A)
6 BASIC programs, type 2 (MZ-80K)
7 BASIC programs, type 5 (MZ-700 / MZ-800)
8 Miscellaneous programs
9 Miscellaneous programs

Troubleshooting

Monitor boots but "RFS" is not shown in the banner

  • SD card not inserted — check the card is seated in the reader on the RomDisk board.
  • SD card not formatted correctly — the SDCFS image must start at sector 0, with no partition table. Re-write with dd as described above.
  • Wrong ROM image — verify you programmed the Monitor ROM and User ROM chips with the correct images for your hardware target (RomDisk vs picoZ80).
  • SPI not connected — on RomDisk v2+ boards, ensure HW_SPI_ENA = 1 in rfs_definitions.asm before building. On v1 boards use PP_SPI_ENA = 1.

Machine crashes or behaves erratically after loading a program

  • ROM image mismatch — the Monitor ROM and User ROM must be built from the same source tree and for the same target. Mixing images from different builds can produce unpredictable bank-switch addresses.
  • Program overwrites RFS workspace — programs that use all of 0x1200–0xCFFF may overwrite the RFS bank-switch stubs at 0xE800. Programs designed for the original monitor should generally be unaffected; self-modifying programs or those that jump to arbitrary addresses may not be.

CP/M does not boot or shows errors

  • SD card image incomplete — CP/M disk images begin at the 256 MB boundary on the SD card. Ensure the full SHARP_MZ80A_RFS_CPM_IMAGE_1.img was written — partial writes will leave CP/M disk area uninitialised.
  • Active drive has no CP/M boot sector — select drive 0 before typing CPM, as the pre-built image places the CP/M boot sector on drive 0.
  • Floppy not connected — if using the SFD-700 build and no floppy is connected, floppy-related CBIOS operations will time out. Use the SD card CPM boot instead.

Reference Sites

Resource Link
RFS project page /sharpmz-upgrades-rfs/
RFS Technical Guide /sharpmz-upgrades-rfs-technicalguide/
RFS Developer’s Guide /sharpmz-upgrades-rfs-developersguide/
RFS Gallery /sharpmz-upgrades-rfs-gallery/
SFD-700 mkII (floppy controller) /sfd700/
picoZ80 (RP2350 Z80 replacement) /picoz80/
GLASS Z80 Assembler Bundled in tools/glass.jar
NASCOM Basic Manual Bundled in repository docs/ directory