REVIEW - Programming Embedded Systems in C and C++


Programming Embedded Systems in C and C++


Michael Barr



O'Reilly (1999)




Francis Glassborow


October 1999



This is an interesting book and a good place for those interested in the topic to start their study. I am not convinced that the title is an effective description of the content. The author starts by assuming that the reader will be reasonably familiar with programming and have a basic grasp of doing this in C and C++. I think he is being optimistic in assuming that those whose claim to know either language is based on having written a program using C++ Builder or Visual C++ - using its wizards to generate most of your code - would provide an adequate basis.

Much of this book is about the fundamentals of what an embedded system is and how you tackle the task of programming for one (things like the need for hardware initialisation and the need for working with a simulator).

In chapter 8 the author introduces his own operating system (I think that is a little grandiose) which he describes as being neither the best nor the worst in any aspect. He claims that it is about 1000 lines of code with 75% being platform independent and written in C++. Later (in chapter 9) he comments on the difficult decision to use C++ in view of the performance and code size costs. I have to say that I think he has simply assumed that the current mythos is correct on this subject (I have evidence to the contrary). Actually any compiler for generating effective embedded system code needs special features. Professional coders for embedded systems do not generally use standard C compilers and they tweak their C source code. If the same applies to your C++ then I would expect you to get equivalent results.

The thing that does not come across strongly enough in this book is that writing embedded system code requires a very different mindset from that used for other types of programming. Even though some embedded hardware now provide substantial resources (memory, multiple registers, external interfaces etc.) the programmer is always constrained by what she has (adding more memory is rarely an option).

Do not expect too much from this book (the main text only spans 148 pages) but if you want to have a look at the subject before committing to it you could do far worse than read this book. Those who fell into programming a specific embedded system (probably at assembler level) and want to systematise their understanding could also benefit from reading this book.

Book cover image courtesy of Open Library.

Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.