Skip to main content

1982 | OriginalPaper | Buchkapitel

Loops Within Loops

verfasst von : Anthony Woods

Erschienen in: Assembly Language Assembled for the Sinclair ZX81

Verlag: Macmillan Education UK

Aktivieren Sie unsere intelligente Suche um passende Fachinhalte oder Patente zu finden.

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.

Metadaten
Titel
Loops Within Loops
verfasst von
Anthony Woods
Copyright-Jahr
1982
Verlag
Macmillan Education UK
DOI
https://doi.org/10.1007/978-1-349-06620-9_8