Using Go To


In some cases, you may prefer to transfer control to an instruction by referring to its program address instead of using a label. The address of an instruction is the step number of the instruction as shown by the calculator's program counter.


Determining the Address of an Instruction

To find the program address of an instruction you have stored in program memory:
  1. Press [ LEARN ] and use { 1st }, { PC }, or { END } to enter the learn mode at the piont nearest the instruction.
  2. Use the [ ] and [ ] keys to position the cursor on the instruction. The address of the instruction is shown by the program counter.

For example, suppose you want to find the program address of the PAU instruction in the program entered in the previous section. If you apply the procedure described above to place the cursor over PAU, the display should show:

D_aOncV4

In this case, the address of the PAU instruction is 0006.

Transferring Control by Address

The GTO ( go to ) instruction transfers control to a specified program address. To enter a GTO instruction in a program, use the key sequence

[ INV ] [ 2nd ] [ GTL ] nnnn

where nnnn represents the address of the instruction you want to execute next. For example, GTO 0150 transfers control to the instruction at program address 0150.

You can use short form addressing, as described in the "Memory Operations" chapter of the RPD-95 User's Guide, to specify the address.


Back