CHAPTER 5

Branching and Looping

Computers derive much of their power from their ability to selectively execute code and from the speed at which they execute repetitive algorithms. Programs in high-level languages like Java or C++ use if–then, if–then–else, and case structures to selectively execute code, and loop structures such as while (pretest) loops, until (posttest) loops, and for (counter-controlled) loops to repetitively execute code. Some high-level languages have a goto statement for unconditional branching. Somewhat more primitive languages (like older versions of FORTRAN or BASIC) depend on fairly simple if statements and an abundance of goto statements for both selective execution and looping.

The 80×86 assembly language programmer’s ...

Get Introduction to 80x86 Assembly Language and Computer Architecture, 2nd Edition 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.