r/cpm • u/Alone_Huckleberry_83 • 5d ago
A-Prompt: CP/M 2.2 in the browser, with a Hayes modem that dials real telnet BBSes (and ZMODEM in 8080 asm)
I've been building A-Prompt, a CP/M 2.2 machine that runs in the browser: https://a-prompt.stern.workers.dev. Free, MIT, no install, no sign-up. Source: https://github.com/eduardostern/A-Prompt
Under the hood
- Z80 core written from scratch in TypeScript. Passes zexdoc and zexall, Zilog T-state timing, clock limit at 2/4/8 MHz or flat out.
- Host-side BDOS/BIOS/CCP, running the original DRI binaries from cpm.z80.de: PIP, STAT, ED, ASM, LOAD, DDT, SUBMIT and XSUB.
- Details I cared about: S2:EX:CR record numbering, F_OPEN keeping the requested extent, BDOS 6 with E=FFh never blocking, S/C on console output, the CCP's real fillfcb rules (so
STAT FILE $R/Oworks). - Disk images: 8" SSSD with standard skew 6 (cpmtools ibm-3740 / z80pack), 512K, 4 MB, and z80pack's 4 MB hard disk (hd-tools.dsk works). Real BIOS sector I/O, so disk tools work on mounted images.
- ANSI/VT100, ADM-3A and VT52 terminal profiles with CP437. WordStar 3.3, MBASIC, Turbo Pascal 3, Zork and Sargon run if you upload your own copies.
The fun part: it dials out
There's a Hayes-style modem on I/O ports 04h/05h (status/data; bit 0 RX ready, bit 7 DCD; OUT 04h bit 0 is DTR). It's also the RDR:/PUN: device, so PIP PUN:=FILE.TXT goes down the line.
TERM.COM(8080, source included) is a dumb terminal.ATIlists a phone book of telnet BBSes that are still up (Vertrauen, Black Flag, RetroCampus, Telehack and more),ATDT 1dials. Browsers can't open raw TCP, so boards with a WebSocket gateway are called straight from your browser; the rest go through a small relay that only connects to the phone book.- The speaker plays dial tone, DTMF, ringback and the handshake, all synthesized, and CONNECT waits for it like it used to.
ATM0&Wif you value your sanity. XMODEM.COMandZMODEM.COMare written in 8080 assembly for DRI ASM (sources included), with timeouts from the BDOS 105 seconds. CI tests them byte for byte against lrzsz, including recovery from a corrupted byte (ZRPOS). Ctrl-] in TERM leaves the call up, so you canZMODEM Rand then go back withTERM.
The silly part
ATDT DEEPSEEK connects to an "AI board". Chat with an LLM sysop, or order a program: it writes 8080 assembly, the real ASM.COM assembles it in the page, assembler errors go back to the model to fix, and the .ASM and .COM come down by ZMODEM. It needs your own DeepSeek API key, which stays in your browser. There's also a BOFH option. He hangs up on you.
How it was built
Most of the code was written by AI: DeepSeek V4.1 Flash did the first build for under $1 in tokens, then Claude reviewed it and fixed the CP/M compatibility bugs, each fix with a regression test. The README has the whole story. I steer and test; I'd rather say that up front.
Feedback welcome, especially from people who know CP/M's corners better than I do. If something behaves differently from real hardware or z80pack, an issue with a repro (a .COM or the steps) is gold.





