Execute program TORSV step by step. Use a = 6 and b = 8.
Select the VAR menu and enter the data. Enter the program name and start the debugging. HLT indicates
program execution is suspended.
@· J6 `8 `O%TORSV%
Display and execute the first program step. Notice that it takes the two arguments from the stack and stored
them in local variables a and b.
Continue single-stepping until the status area shows the current directory. Watch the stack and status area
as you single-step through the program.
%SST% ... %SST%.
To single-step from the middle of a program:
1. Insert a HALT command in the program where you want to begin single-stepping.
2. Execute the program normally. The program stops when the HALT command is executed, and the HLT
3. Take any action:
To see the next program step displayed in the status area and then executed, press %SST%.
To display but not execute the next one or two program steps, press %NEXT%.
To continue with normal execution, press !=.
To abandon further execution, press %KILL%.
4. Repeat the previous step as desired.
When you want the program to run normally again, remove the HALT command from the program.
To single-step when the next step is a subroutine:
To execute the subroutine in one step, press %SST%.
To execute the subroutine step-by-step, press %SST°%.
%SST% executes the next step in a program — if the next step is a subroutine, %SST% executes the subroutine in
one step. %SST°% works just like %SST% — except if the next program step is a subroutine, it single-steps to the
first step in the subroutine.
In the previous example, you used %SST% to execute subroutine TORSA in one step. Now execute
program TORSV step by step to calculate the volume of a torus of radii a = 10 and b = 12. when you reach
subroutine TORSA, execute it step by step.
Select the VAR menu and enter the data. Enter the program name and start the debugging. Execute the first four
steps of the program, then check the next step.
1-30 RPL Programming