The RS08 is an 8-bit processor not designed with high-level languages in mind. You must observe certain points to allow the Compiler to generate reasonably efficient code. The following list provides an idea of what is "good" programming from the processor's point of view.
- Use the restrict keyword as a hint for the pointer to thread function argument descriptors.
- Use 8-bit computations unless larger types are absolutely required. The RS08 core is an 8-bit MCU, so 16-bit arithmetic operations are expensive, since they are implemented by runtime calls.
- Limit the number of local variables, since storage space is limited.
Using
unsigned types instead of
signed types is better in the following cases:
- Implicit or explicit extensions from
char to
int or from
int to
long.
- Use types
long,
float or
double only when absolutely necessary. They produce a lot of code.