Previous Topic: A Program That Repeats a StringNext Topic: Explanation


Sample Program

The program that produces this output is shown below:

*** This program says "hello" 10 times *** 
* 
             OPTION MAXI,200         maximum instructions 
             CLEAR                   press the 'CLEAR' key 
             SET A1,0                zero loop counter 
             SET A2,10               set max loop value 
MORE         NL 1                    go to next input line 
             KEY 'Hello, &USERID'    say "hello."
             ADD A1,1                increment counter 
             COMPARE A1,A2           test A1 and A2 
             BRANCH LT,MORE          repeat til A1 = 10 
             STOP