Close

CP/M on badge, quick guide

A project log for Badge for Hackaday Conference 2018 in Belgrade

In the 1980's, you had to know programming to use computers. They were used for... guess what? Computing! Want to see how it looked?

Mike SzczysMike Szczys 05/14/2018 at 21:410 Comments

After you start Z80 emulator with CP/M, the machine boots up on A drive greeting you by prompt

A>

There is not much to do with this drive, as it is 22kB RAM disk. It is empty after boot, as you can try with command

dir

that prints what is in current directory. You can switch to disk B, where is more to be found

b:

and system will respond with

B>

meaning you are there. You can now list content of this directory again and discover a few executable (.COM) files, like XMDM, MBASIC or FORTH. You can play around with those; notice that some of them expect different line (CR) end than what badge uses (LF). You can do CR line end by hitting SHIFT+ENTER. Exit MBASIC by typing system<CR>.

On disk C you have some more goodies, namely famous ZORK game and SARGON chess game.

Disk D is empty, with 512kB of capacity. You can copy files to/from disks utilizing PIP program, with syntax of

pip d:=c:zork1.com

that will copy file zork1.com to drive d. Notice you should run this one from disk B, where pip resides, or explicitly set path to pip program.

If you want to erase the file, just type

era d:zork1.com

If you happen to need to list ASCII file, invoke command

type file.txt

or dump binary file in hexa form by running

dump file.bin

Stat command is used to display statistics of a file or drive; you can run

b:stat

to display info of drives or

b:stat *.*

to display information about all files on particular drive. Notice the wildcards - you can use it when copying or erasing the files too.

If you want to transfer files from computer (or perhaps another badge), you may use XMODEM program. Run

b:xmdm r d:filename

to start saving received file on D drive, and start XMODEM transfer on other side. The transfer speed is 19200 baud. You may try to archive files into ARC format and un-arc it on CP/M side with dedicated software, if you want to transfer more files. On linux, you may want to use sx to transfer files, or moserial or cutecom for GUI access, with windows, teraterm is good option.

You may want to try assembler toolchain consisting of ED editor, ASM assembler, LOAD program to convert hex to .COM file and DDT debugger. There is quite a lot of Z80 CP/M software on the interwebs, you may want to look for "walnut creek CP/M CD". Be prepared that a lot of CP/M software was designed for modified machines, sidetracking BIOS, so it may not run on this particular machine.

Notice badge has option to switch from local standard input/output (keyboard/display) to serial port (on pins C13 and C14 on expansion port, 3,3V levels, don't forget ground) by pressing LSHIFT+RSHIFT+BRK; with the same combination taking you back to local access. You may access the command line using terminal emulator on your PC, gaining somehow more comfortable access.

You can find more details about the CP/M commands and programs here and here.

Discussions