Section 11: Branching and Looping165
If you execute DSE from the keyboard, it simply decrements the specified register just like it would in a program.
Example: Here is a program that illustrates how ISG works. It contains a loop that pauses to display the current value in register R10, displays the square of that number, and uses ISG to control the number of passes through the loop and the value of the squared number. The program generates a table of squares of even numbers form 2 through 50.
Keystrokes Display    
PRGM 
       
   
g GTO · · 
  00 REG 46    
   
g LBL 
       
   
ALPHA EVENS ALPHA 
  01 LBLTEVENS    
  The program name, EVENS.
2.05002 
  02 2.05002 _    
  The loop control number. Beginning with 2, increments up to 50 by twos. Test each execution to see if the counter is greater than 50.
STO 01
  03 STO 01    
  Stores the loop control number in R01.
g LBL 01
  04 LBL 01    
  Begins the loop.
RCL 01
  05 RCL 01    
  Recalls the number in R01.
XEQ 
       
   
ALPHA INT ALPHA 
  06 INT     
  Takes the integer portion of the number.
XEQ 
       
   
ALPHA PSE ALPHA 
  07 PSE     
  Displays the integer portion of the number.
g X2 
  08 X     
  Squares the number.
XEQ 
       
   
ALPHA PSE ALPHA 
  09 PSE     
  Displays the square of the number.
g ISG 01
  10 ISG 01    
  Increments R01 by 2 and checks to see that the counter is not greater than the final number (50). If the counter is not greater than the final number, executes the next line. If the counter is greater than the final number, skips the next line in the program.
g GTO 01
  11 GTO 01    
  Loops back to LBL 01.
g GTO · · 
  00 REG 42