The total number of instructions for the C version is 28. The original as- sembler version used 20, giving an increase of 40% for the C version, in this case.
We are not going to look at the C language in any further detail here, but this example is given so that the advantages of C programming for microcontrollers can be appreciated. When assembly language has been mastered, the developer can then decide if C would be a better choice for given applications. For those needing complex mathematical calculations, for example, C is a better choice. For simpler programs comprising more bit