Introduction¶
DCC C Compiler is an open source C compiler for CP/M 2.2 on the Z80. It supports C89 plus CP/M-relevant C99/C11 features. For every source
file it accepts, the DCC C Compiler translates the .c file to M80 assembly; M80 assembles the
result, and L80 links it into a CP/M .COM program.
The DCC C Compiler runs on Windows, macOS, and Linux, but the programs it builds run under CP/M. The ntvcm emulator and other popular CP/M Z80 emulators run those programs, as do real Z80 CP/M 2.2 and 3.0 systems.
Integrated VS Code debugging
Debug DCC programs directly in Visual Studio Code with source breakpoints, source and instruction stepping, call stacks, variables and watches, memory inspection, and linked Z80 disassembly. See VS Code debugging for setup and usage.
This manual describes the language accepted by the DCC C Compiler, the runtime library, and the
build path from C source to .COM file.
- Start with Setting up the toolchain.
- See Building and linking for the normal build flow.
- See C conformance and target exceptions, Types and conventions, and Operators for the language rules.
- Use the library reference for assert.h, ctype.h, errno.h, float.h, limits.h, math.h, setjmp.h, stdarg.h, stdbool.h, stddef.h, stdint.h, stdio.h, stdlib.h, string.h, and system / CP/M services.
- Read Limitations before depending on hosted-C behavior.
- Try the worked examples when you want complete programs.
- Use Agentic skills if you want an AI assistant to load the DCC C Compiler rules while working in another project.
Runtime¶
DCCRTL.MAC is the runtime. It is Z80 assembly in M80/L80 syntax. It supplies:
- the
startentry point, which sets up the heap and callsmain, - command-line parsing for
argcandargv, - the supported C library routines,
- integer and floating-point helpers used by generated code.
Normal builds trim the runtime before linking. Unused routines are left out of
the final .COM file. The build steps are shown in
Building and linking; the trimming details are in the
dccrtlstrip appendix.
Single source of truth
Functions that are declared in the standard headers but are not part of the linked runtime are called out explicitly in Limitations so a missing function never surprises you at link time.
Performance Snapshot¶
The chart compares .COM programs produced by the DCC C Compiler with CP/M-era and modern
CP/M-targeting compilers. Times come from ntvcm -p cycle counts converted to
the emulator's approx ms at 4Mhz value for Z80-mode runs. Sizes are CP/M file
sizes rounded to 128-byte records. Lower is better for ms and bytes.
The benchmark names are the test programs: strings and memory (tstring),
sieve, digits of e, allocation (tm), tic-tac-toe (ttt), hexadecimal pi
digits (pihex), and matrix multiply (mm). Rows labelled xcomp are DCC C Compiler
output before dccpeep; rows labelled dccpeep optimized are after the
optimizer pass.
Engineering Notes¶
DCC C Compiler was engineered agentically using VS Code GitHub Copilot and Claude Code for VS Code, with plenty of human intelligence, supervision, experience, and patience. It is unit tested against baselines grounded in modern C compilers and a platform-appropriate subset of the community-driven c-testsuite.
Contributions and Feedback Welcome¶
This is an open source C compiler. Community contributions are welcome; please report issues through the project's GitHub Issues page.
Star the Repository¶
If the DCC C Compiler is useful to you, please consider starring the GitHub repository. It helps other CP/M and Z80 developers find the project.

