Skip to main content
Top

1982 | OriginalPaper | Chapter

Loops Within Loops

Author : Anthony Woods

Published in: Assembly Language Assembled for the Sinclair ZX81

Publisher: Macmillan Education UK

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

A natural follow-on to the loops which have been used so far is to put a loop inside another loop. This type of construction is known as a nested loop. The terms outer loop and inner loop are then used to describe the loop forming the outside of the nest and the loop which is on the inside of the nest. Figure 8.1 shows a program which has two loops, one inside the other. This program outputs four lines of six asterisks. The outer loop uses the C register to count the number of lines and the inner loop uses the B register to count the number of asterisks.

Metadata
Title
Loops Within Loops
Author
Anthony Woods
Copyright Year
1982
Publisher
Macmillan Education UK
DOI
https://doi.org/10.1007/978-1-349-06620-9_8

Premium Partner