• Please review our updated Terms and Rules here

CPM86 C Compilers?

MikeI

Experienced Member
Joined
Apr 4, 2025
Messages
77
i have Aztec C vers 3.2 for CPM86 running on my MPM86 system and it seems to run well, but am looking for something a bit closer to ANSI and have found nada! So …. Any pointers to one???? Suppose I can try a cross development route but thought I’d ask in case I’ve missed an obvious one
 
Borland did a Turbo Pascal for CP/M-86.

I am not sure whether their Turbo C made it to the same platform though.

Worth a look...

Dave
 
The bcc compiler supports neither CP/M-86 nor ANSI-C, but instead uses unproto [here] to deal with ANSI-C source code.

Unproto was originally written in K&R C to allow pre-ANSI compilers on UNIX to compile newer code and especially bootstrap better compilers.

Maybe it is useful?
 
Borland did a Turbo Pascal for CP/M-86.

I am not sure whether their Turbo C made it to the same platform though.

Worth a look...

Dave
Turbo Pascal is a sibling to the Danish PolyPascal (https://datamuseum.dk/wiki/PolyPascal - better run through a translator) which originated on CP/M-80 but was either written originally or turned into a form making it easy to generate binaries for multiple platforms. The WordStar compatible editor was pretty good. But in Denmark there had been a political decision to buy Danish computers in the early eighties and the primary vendor - Regnecentralen - was everywhere in the Danish schools. Regnecentralen bet on CCP/M-86 for their 16-bit machine, so there was a large market for PolyPascal in Denmark which probably is the reason the CP/M-86 port was made while making the MS-DOS port.

My guess is that Borland just chose to market that too. Then Anders Hjejlsberg went with Borland to develop Turbo Pascal 4 for MS-DOS and PolyPascal was not developed any further.

I sincerely hope the PolyPascal sources are opened at some time.
 
I could only find Digital Research C at http://www.cpm.z80.de/binary.html - probably not new enough for what you want :-/

You may find https://github.com/tsupplis/cpm86-crossdev interesting...
thanks for the pointer to this one ... looks older than the Aztec but will spin it up .... EDIT: yes, it works under MPM-86, ( for the little sample file ) ... pretty basic compiler, has maybe 5 include files, dates from 1984 .. Aztec seems to be a lot more capable but this is a great example of the state of early C.
 
Last edited:
thanks for the pointer to this one ... looks older than the Aztec but will spin it up .... EDIT: yes, it works under MPM-86, ( for the little sample file ) ... pretty basic compiler, has maybe 5 include files, dates from 1984 .. Aztec seems to be a lot more capable but this is a great example of the state of early C.
I had a look at if there were any modern compilers targetting 16-bit x86, which would be the prime candidates for creating a CP/M-86 sibling to MS-DOS 1.0. Unfortunately the only one I could find was a resurrected gcc at https://codeberg.org/tkchia/gcc-ia16 which supports MS-DOS, which probably could be coerced into generating CP/M-86 too. Aztec C has runtime library source, which could be used to ensure the converted OS calls were correct. LLVM does not as far as I could see.

Something that somebody with time on their hands and a large AI-subscription most likely could get in the air for you with a reasonable amount of effort 🙂
 
I’m using Aztec C68K/ROM 3.6b to build the CP/M-68K versions of my CRC program (https://gitlab.com/dps8m/crc), using David Lee’s CP/M-68K support. It needed some fixes but those are upstream now and the version in my repo (https://gitlab.com/johnsonjh/old_c/) matches his. It’s OK if you can deal with K&R.

I also have the ANSI version (5.2) but haven’t yet adapted it for CP/M-68K, but it wouldn’t be *too* much work.
 
I apologize, I guess I dyslexicly read 68 and not 86.

https://github.com/tsupplis/cpm86-crossdev contains Aztec C86 v3 (K&R) and v5 (ANSI) setup as a cross-compiler from Linux or macOS and it works well.

I do have a patch I’m waiting for him to merge at https://github.com/tsupplis/cpm86-crossdev/issues/22.
You may want to create a pull request with a test that fails on the current code and succeeds with the patch applied in one commit, and the patch itself in another commit.

Tends to make things easier for the maintainer 🙂
 
I had a look at if there were any modern compilers targetting 16-bit x86, which would be the prime candidates for creating a CP/M-86 sibling to MS-DOS 1.0. Unfortunately the only one I could find was a resurrected gcc at https://codeberg.org/tkchia/gcc-ia16 which supports MS-DOS, which probably could be coerced into generating CP/M-86 too. Aztec C has runtime library source, which could be used to ensure the converted OS calls were correct. LLVM does not as far as I could see.

Something that somebody with time on their hands and a large AI-subscription most likely could get in the air for you with a reasonable amount of effort 🙂
I've decided I probably need a suitable C compiler when looking at the 16-bit successor to my pet projekt (I need it running well in MAME and utilities for that). I have not found anything newer either, but it may be possible to get a reasonable hybrid by adapting the Open Watcom compiler which can generate 16-bit x86 to an existing runtime library of either Aztec C or Digital Research C.

Github Copilot could generate a "Hello World" program in a single session (only a single BDOS call and an exit) in both assembly and C so the understanding of how to do it should be in place. So... a promising start 🙂
 
Back
Top