1982 | OriginalPaper | Chapter
Loops Within Loops
Author : Anthony Woods
Published in: Assembly Language Assembled for the Sinclair ZX81
Publisher: Macmillan Education UK
Included in: Professional Book Archive
Activate our intelligent search to find suitable subject content or patents.
Select sections of text to find matching patents with Artificial Intelligence. powered by
Select sections of text to find additional relevant content using AI-assisted search. powered by
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.