7

Program structures

In Chapter 6 we saw the variety of instructions that are available to a programmer of the G80. In this chapter we see how these instructions, and the data on which they operate, are best organized into various structures. Programs are written in order to process data; indeed, what is commonly referred to as a ‘program’ is an algorithm that processes data. Thus we have that ‘Program = Data + Algorithm for processing the Data’. We use program control structures to define the algorithm; we use data structures to store data in a way that helps us devise simple algorithms.

In this chapter, we look first at how instructions may be organized into the three basic program control structures sequence, while, and if/else, and then ...

Get Embedded Systems and Computer Architecture now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.