15 Special Uses of Subfunctions

As we saw in Chapter 14, the most common use of a subfunction is to break a problem into smaller, easier-to-solve subproblems. This is the foundation of recursion, the subject of the first half of this chapter. After we cover recursion, we’ll take a look at another use of subfunctions: directly accessing hardware features in assembly language that may not be easily accessible in a higher-level language.

Recursion

Many computer solutions involve repetitive actions. We saw how to use iterationwhile, for, and do-while loopsto perform repetitive actions in Chapter 14. While iteration can be used to solve any ...

Get Introduction to Computer Organization 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.