Single-Stepping through a Program

It’s easier to understand how a program works if you execute it step by step, observing the effect of each step. Doing this can help you debug your own programs or understand programs written by others.

To single-step from the start of a program:

1.Put the program or program name in level 1 (or the command line).

2.Press !°LL%RUN% %DBUG% to start and immediately suspend execution. HLT appears in the status area.

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.

To turn off the HALT annunciator at any time:

Press !°LL%RUN% %KILL%.

Example: 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% !°LL%RUN% %DBUG%

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.

%SST%

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%.

RPL Programming 1-31