I have to agree that C isn't suited to some targets, as ANSI C makes quite a few assumptions about the hardware model, including:
- That you have a deep stack,
- That you have STDIN, STDOUT and STDERR
- THat you have something to return to (e.g. an OS or DOS prompt)
- That your program and data memory space is the same address space
This is why there is no decent 'C" for 16F84 series PICs (which are great microcontrollers BTW).
I guess that AVR were careful when designing the ATmega to ensure that 'C' almost fits their hardware, except maybe for all that silly PROGMEM stuff...
I'm not clear that ANSI C does make those assumptions, at least not from the point of view of the language itself. The standard C library might be a different issue.
You don't need a hardware stack and as long as you have some sort of "jump and store the current program counter" and the ability to load the program counter with a computed value (even if via a trampoline) you can manage with a stack implemented in software.
STDIN, STDOUT and STDERR are more library than language concepts. You don't
need to '#include <stdio.h> to write C code.
There is also no need for "somewhere to return to" since a C program needn't terminate. Some sort of environment to invoke your program
is needed but that could itself be written in C, perhaps with a little bit of assembly language thrown in (hint, quite a few OSes are substantially written in C).
I'm pretty certain that C itself does not require a single address space - you do need to be able to manipulate code addresses to the extent of being able to store them and jump (or rather call) to a computed address (otherwise function pointers can't be implemented) but the language doesn't say you can read anything from the memory referenced by a function pointer.
Edit
This is why there is no decent 'C" for 16F84 series PICs (which are great microcontrollers BTW).
To be fair, if I'm reading the datasheet correctly (I've never used one) the 16F84 has 1024 words of program memory, 68 bytes of RAM and 64 bytes of EEPROM.
It wouldn't be impossible to target that with a C compiler but I'd think it was a bit of a challenge for
any high level language.