Clean-room CP/M 3.1 implementation for the ZX Spectrum +3.
All code is original Z80 assembly — the BIOS, BDOS, CCP, drivers, and tools are written from scratch.
Currently experimental, not ready for any kind of real use.
- 51×24 and 32x24 screen modes
- Full BDOS with console I/O and file operations
- uPD765A FDC driver with 512→128 byte sector deblocking
- Banked memory — TPA mode (~62K user space) and system mode with bank switching
- MiniCCP with built-in DIR, TYPE, VER, HELP, DUMP commands and
.COMloading - Z80 linter (
z80lint.py) that validates stack balance and register clobbering across all return paths - ZPA preprocessor for source-level abstractions on top of Z80 assembly
- RTC clock although stalls during disk-IO like Locomotive version
- BBCBASIC.com
- Mallard BASIC
- Ed
- Pip
- B: drive
- Custom formats (CPC + XDPB formats like PCW 720K)
- Various other simple CP/M tools
- Date.com with Y2K compliance
- Dump.com with screen-width adaption
- Showxdpb.com - Show the eXtended Disk Parameter Blocks
- bdostest.com - Testing the CP/M BDOS functions 1-35
- termtest.com - Testing the terminal emulation/ESC codes
- disktest.com - Testing file and disk operations
- .SUB execution
- Format command
- RAMdisk support
- 64-column mode
- User area/file spec on command lines
- Serial I/O
- Printer/parallel I/O
- Disckit.com
| Range | TPA Mode | System Mode |
|---|---|---|
| 0000–00FF | Page zero (vectors) | Bank 4 — BIOS, BDOS, drivers |
| 0100–F9FF | ~63K user TPA | |
| FA00–FFFF | Common stub (bank 3) | Common stub (bank 3) |
Banking is controlled via port 0x1FFD. See AGENTS.md for full architectural details.
Requires sjasmplus and Python 3.
# Lint the source
python3 tools/z80lint.py
# Build the disk image
build.cmd
# Build with additional files
build.cmd --add FILE ...Output: build/cpm3.dsk — a standard +3 disk image ready for emulation.
Use the zx84 MCP emulator:
model +3
load build/cpm3.dsk
disk_boot
run 1000
src/
boot/ Boot sector and stage-2 loader
bios/ BIOS, screen/keyboard/FDC drivers, common memory stub
bdos/ BDOS (console + file I/O)
ccp/ MiniCCP command processor
util/ CP/M utilities (.COM programs)
test/ Test programs
tools/ Build tools (mkdsk, zpa preprocessor, linter, patchsum)
docs/ API reference, filesystem documentation
This project is licensed under the MIT License.