Finally achieved my goal of a JavaScript-based Z80 CP/M emulator!
For a while now I have been wanting to get my JavaScript CP/M emulator working.
Z80 CPU emulation was working great, and *parts* of CP/M were working. You could run Microsoft BASIC and load and execute Star Trek, for example.
But even with a ton of debugging, BDOS references, and the slop-making-plagiarism-machine, it just would crash on doing anything more advanced than that, such as compiling C programs using Hi-Tech C.
Hair-pulling no longer, it works! You can even play Rogue.

I did have to “cheat”, of course.
Once I knew I could have DOSBox running in a web browser, it was just a case of finding a working and capable CP/M that ran on DOS.
You should remember at this point that DOS and CP/M have a “history”, but also most of the people who wanted to run CP/M on an x86 machine had DRDOS and CP/M86 right there.
Fortunately, there is an amazing and compact CP/M80 emulator called MyZ80 and not only does it do what I need to bundle the compilers etc that I want, it allows import and export of files to the host OS, which *should* allow me to pass in and out files from my online IDE. Maybe.
So that is the next job, but for now I am happy to get this far.
I will leave the old CP/M emulator available in /old/ as I do like how you can select your own disks, but I think getting the ability to run more software is a fair exchange.
To get you started I have include some useful stuff.
Drive A:
- Rogue – Dungeon game
- Ed – Line-based text editor
- WS – WordStart classic word processor and text editor (use ‘N’ non-document format)
- Z80ASM – Z80 Assembler
- TE – Text Editor
- ZDE – Another text editor
- ASM – CP/M Assembler
Drive B:
- MBasic – Microsoft BASIC
- StarTrek.bas – Classic Star Trek game
Drive C
- C – Hi-Tech C compiler
- Turbo – Turbo Pascal, also a decent text editor built-in
Keyboard shortcuts
- CTRL + E : Forces the cursor to the next line of the screen for continued command line input.
- CTRL + X : Erases the current command line and moves the cursor back to the beginning of the line.
- CTRL + Z : Terminates input from the keyboard (used in combination with certain CP/M transient commands).
- CTRL+C: Quit a program
DIR [d:][filematch]
Display a list of files in the specified, or current drive.
ERA [d:][filematch]
Erase specified files.
REN [d:]newname.ext = oldname.ext
Change the name of a file from oldname.ext to newname.ext
SAVE n [d:]filename.ext
Save the specified n number of pages of the transient program area to disk under the specified file name.
TYPE [d:]filename.ext
Display the contents of the specified file on the display screen. Display is only meaningful if the file contents was ASCII text.
USER n
Switches to the specified user area in a disk drive. A user area is a physical area on a disk which has its own directory and which is managed seperately from the rest of the disk. Data cannot be read from or written to any user area other than that in which CP/M is currently operating. A disk can be divided up into a maximum of 16 user areas.
PIP [d:]destination.ext=[d:]sourcefile.ext
Copy a file to destination from source file.
.png)

