2. Press {Vlabel to set the program pointer to the start of the program (that is, at its LBL instruction). The ! instruction moves the program pointer without starting execution. (If the program is the first or only program, you can press {Vto move to its beginning.)

3.Press and hold š. This displays the current program line. When you release š, the line is executed. The result of that execution is then displayed (it is in the X–register).

To move to the preceding line, you can press ™. No execution occurs.

4.The program pointer moves to the next line. Repeat step 3 until you find an error (an incorrect result occurs) or reach the end of the program.

If Program–entry mode is active, then šor ™simply changes the program pointer, without executing lines. Holding down a cursor key during program entry makes the lines roll by automatically.

Example: Testing a Program.

Step through the execution of the program labeled A. Use a radius of 5 for the test data. Check that Program–entry mode is not active before you start:

Keys:

Display:

Description:

(In RPN mode)

 

 

5 {VA

)

š(hold)

  

(release)

)

š(hold)

 º

(release)

)

š(hold)

 π

(release)

) 

š(hold)

 º

(release)

) 

š(hold)

 !

(release)

) 

Moves program counter to label A.

Squares input.

Value of π.

25π.

End of program. Result is correct.

12–10Simple Programming

Page 168
Image 168
HP 33s Scientific manual 12-10Simple Programming, Example Testing a Program