The CP/M platform is a surprisingly useful port when used in combination with ZXCC, the two together can easily test whether an algorithm works, or whether there’s an issue in the compiled output code.
ZXCC is trivial to extend, and you can easily permit access to serial ports, host system calls, advanced paging techniques etc testing out many areas of your code.
zcc +cpm ....
Without specifying a -o option, a file called a.com is produced, this can be run with zxcc as follows:
zxcc a.com
Besides the standard library routines, the bdos() function call allows direct access to the bios of the system.
Some hardware specific functions have been adapted to run on both native platorm and generic CP/M environment.
There are a couple of #pragma commands which might be used to cut down the size of the resultant executable:
#pragma output nostreams - No stdio disc files
#pragma output nofileio - No fileio at all
#pragma output noprotectmsdos - strip the MS-DOS protection header