248/317
8 - C Language and the C Compiler
8.8.4.3 Limit the size of variables to the very minimum
Do not use long integers where integers are sufficient; and above all, avoid using floating arith-
metic. Floating operations take a long time to process, and may impede the response time of
a program. In addition, floating arithmetic does not guarantee proper results for equality tests.
Sine the ST7 is a 8-bit machine, try to use as
char
variables as often as possible.
Another point about long and floating arithmetic was described earlier, some precautions are
needed when interrupts are used.
8.9 CONCLUSION
This chapter has demonstrated that C language is well suited to microcontrollers like the ST7;
when care is taken as specified throughout this chapter, the performance of the program
written in C is adequate, and the ease you will gain writing it will make you have no regrets
about using it rather than assembly programming. C makes debugging, documenting and
maintaining your software easier, and will better prepare you to face the requirements of soft-
ware quality assurance.
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...