Logo of FloppySoftware

Developing software since 1987

MESCC / Mike's Enhanced Small C Compiler


MESCC is my project of a C compiler for the CP/M operating system and the Z80 cpu.

As it is written in MESCC, it can compile itself.

It is based on the version 1.7 (Oct. 1985) of Small C by Ron Cain, Mike Bernson's and John Hill.

MESCC generate Z80 assembler code that can be assembled with ZSM/Z80ASMUK (included with MESCC), in order to generate an HEX file.

The HEX file can be converted to an executable COM file with LOAD (supplied with CP/M 2), HEXCOM (supplied with CP/M 3) or HEXTOCOM (included with MESCC).

Also is included CCOPT, a peephole optimizer.

It is supplied with a bunch of libraries:

  • mescc.h   : Runtime. All programs must include this file first.
  • alloc.h   : Memory allocation functions.
  • atexit.h  : Code for atexit() function.
  • bsearch.h : Binary search function.
  • clock.h   : Date & time functions for CP/M Plus.
  • conio.h   : Console I/O functions.
  • cpm.h     : CP/M specific functions.
  • ctype.h   : Test and character conversion functions.
  • fileio.h  : Stream file I/O functions.
  • fprintf.h : Formatted output to file.
  • mem.h     : Memory functions.
  • printf.h  : Formatted output to console.
  • qsort.h   : Sort function.
  • rand.h    : Pseudo-random number generation.
  • setjmp.h  : Non-local jumps.
  • sprintf.h : Formatted output to memory.
  • string.h  : String functions.
  • xprintf.h : Support library for printf, fprintf and sprintf.
  • z80.h     : Z80 specific functions.

I use it for (nearly) all my software projects.

The compiler will show you a help text if it is executed without arguments.