Skip to content

Repository files navigation

P2000C emulated assembler

GitHub Actions status Version License

p2000c-asm is a small command-line frontend for the original CP/M ASM.COM and LOAD.COM. It executes both programs on an emulated Z80 and maps the few CP/M BDOS services they need directly onto host files. It does not boot CP/M, create a disk image, or emulate the P2000C hardware.

Build

GNU GCC is the intended toolchain:

CC=gcc CXX=g++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build --output-on-failure

The executable is build/p2000c-asm.

Use

./build/p2000c-asm PROGRAM.ASM
./build/p2000c-asm -o bin/PROGRAM.COM --keep-intermediates PROGRAM.ASM

The default output is PROGRAM.COM beside the source. Input with LF, CR/LF, or CR line endings is accepted and converted to CP/M text in a temporary directory. The source itself is not modified.

--keep-intermediates also writes the .HEX and .PRN files. Use --verbose to show the original programs' console output.

Run p2000c-asm --help for all options.

CP/M programs

The historical ASM.COM and LOAD.COM are runtime data, not linked into the host executable. By default CMake copies cpm/ASM.COM and cpm/LOAD.COM beside the built executable. Alternate copies can be selected with --asm and --load, or with the P2000C_ASM_COM and P2000C_LOAD_COM environment variables.

Source names must follow the CP/M 8.3 limit. This version intentionally supports one source file per invocation.

About

Minimalistic stand-alone emulated CP/M 8080 assembler

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages