Great Compilers: The Hi-Tech C Compiler

Randall Maas 5/14/2010 1:41:52 PM

When I work on a project I read the assembly listing that are produced by the compiler. One of the best compilers I have ever encountered is the C compiler from Hi-Tech C. It produces amazingly tight code for 8 microcontrollers with only a few bytes of RAM and program memory. Things like the 8051, PIC10, PIC12, PIC16, etc.

It implemented excellent compilation of division by constant integer values. It let you name bits ' that is, have boolean variable that is one bit wide. It's analysis could tell which variables where never used at the same time and conserve memory by sharing the same underlying storage. (Why is that important? The microcontrollers don't have enough memory to implement data stacks, or even much of an activation record).

It's documentation is excellent. It made it easy for me, on a PIC10 project I did once, to use the Carry bit as a boolean return value. And it was configurable that allowed me to support chips that were announced and shipped after the compiler shipped, something which is difficult for others to do in this market.

Microchip bought the High-Tech Soft company, which is great news. The Microchip C18 compiler is _horrible_. It produces terrible code. So it is great that Microchip is funding a great compiler for the PIC microcontrollers. I am saddened that they seem to be planning on not supporting any other microcontrollers, under the logic that it is helping the competition.