Hardware Reference
In-Depth Information
Step 1
Initialize the logical expression C.
Step 2
Evaluate the logical expression C.
Step 3
Perform the specified operations if the logical expression C evaluates to true. Update the
logical expression C and go to step 2. ( Note: The logical expression C may be updated by
external conditions or by an interrupt service routine.)
Step 4
Exit the loop.
True
C
S
False
Figure 2.6 The While … Do looping construct
R EPEAT S U NTIL C
Statement S is first executed then the logical expression C is evaluated. If C is false, the
next statement will be executed. Otherwise, statement S will be executed again. The action
of this construct is illustrated in Figure 2.7. Statement S will be executed at least once. Three
steps are required to implement this construct.
Step 1
Initialize the logical expression C.
Step 2
Execute statement S.
initialize C
S
True
C
False
Figure 2.7 The Repeat … Until looping construct
 
Search WWH ::




Custom Search