© Stephen Smith 2019
Stephen SmithRaspberry Pi Assembly Language Programminghttps://doi.org/10.1007/978-1-4842-5287-1_4

4. Controlling Program Flow

Stephen Smith
(1)
Gibsons, BC, Canada
 
Now we know a handful of Assembly language instructions and can execute them linearly one after the other. We learned how to start and terminate a program. We built programs and debugged them.
In this chapter, we’ll make our programs more interesting by using conditional logic—if/then/else statements—in high-level language. We will also introduce loops—for and while statements—in high-level languages. With these instructions in hand, we will have all the basics for coding program logic.

Unconditional Branch

The simplest branch instruction is
B label
that is an unconditional ...

Get Raspberry Pi Assembly Language Programming: ARM Processor Coding now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.