Section 4: Programming 164
Switch to W/PRGM.
Clear memory by pressing fPRGM.
Key in following sequence.
Keys     Comment
LBL B      
f-1SIN      Compute arc sine.
0      0 to X lifts arc sine to Y.
gx y      Put 0 in Y and arc sine in X.
gx≤y        
3      Test and skip these steps
6      if angle is positive.
0      Add 0 or 360.  
+       
RTN      Stop.

Running the Function

Switch to RUN.
Press   See Displayed   Comment
.5 B  
  30.00
  (degrees)
.5 CHS B  
  330.00
   

Looping N Times

The DSZ operation is useful in repeating a labelled segment of a program a given number of times. The repeated segment is called a loop. Rule: To execute a labeled program segment n times, preset n in R8 and end the segment with a DSZ to determine whether or not to repeat the segment.
   If the angle is negative, 3 6 0 are put into the X register as 360.
  If the angle is positive, 3 6 are skipped and 0 puts zero into X.
  Thus, either 0 or 360 are added to the angle.
  Step saving techniques like this will undoubtedly occur to you in writing your own programs.