Trident Help

RPN Advanced 42 manual · Chapter 7 of 18

Registers and variables

Store and recall numbers in numbered registers and named variables, do arithmetic on stored values, and clear memory.

7.1Where numbers can be stored#

The calculator has 25 numbered registers, 00 to 24, and any number of named variables. Both hold a real number, a complex number or a matrix. Registers 11 to 16 are used by the statistics sums (see Statistics), so avoid them if you use Σ+.

The stack levels X, Y, Z, T and LASTx can also be addressed by name, using the ST prompt.

  1. STO
  2. 2 digits, or ⇧ALPHAENTER + name + ENTER
  3. X is copied there
Storing: STO, then a two-digit register, or shift ENTER and a name

7.2Store a value in a register and recall it#

Press STO; the display shows STO __. Type the register number as two digits (01 for register 1). The prompt finishes by itself after two digits. RCL works the same way and pushes the stored value onto the stack.

The STO prompt waits for a two-digit register number. The display shows: y: 0.0000 / STO __.
The STO prompt waits for a two-digit register number.
Example 7.1

Store 5 in register 01 and recall it later

  1. Type 5 and store it in register 01.

    5STO01
  2. Type 7, then recall register 01. The 5 comes back in X.

    7RCL01
    After step 2: Type 7, then recall register 01. The 5 comes back in X. The display shows: y: 7.0000 / x: 5.0000.
Result of the example "Store 5 in register 01 and recall it later" The display shows: y: 7.0000 / x: 5.0000.
You should seex: 5.0000 y: 7.0000

7.3Store a value in a named variable#

Named variables are easier to remember than numbers. At the STO prompt press shift ENTER to start ALPHA, type the name with the letter groups, and press ENTER. Names can have up to seven characters. See the ALPHA chapter for typing letters.

Example 7.2

Store 4 in a variable called TOTAL

  1. Type 4, press STO, then shift ENTER and type TOTAL, ENTER.

    4STO⇧ALPHAENTERLN√xLOG1/xLN√xΣ+Σ+√x√xENTER
  2. Clear X, then recall the variable.

    ←RCL⇧ALPHAENTERLN√xLOG1/xLN√xΣ+Σ+√x√xENTER
    After step 2: Clear X, then recall the variable. The display shows: y: 0.0000 / x: 4.0000.
Result of the example "Store 4 in a variable called TOTAL" The display shows: y: 0.0000 / x: 4.0000.
You should seex: 4.0000
Example 7.3

The STO prompt lists your variables on the menu keys

  1. Store 1 in AB and 2 in CD, then press STO.

    1STO⇧ALPHAENTERΣ+Σ+Σ+1/xENTER2STO⇧ALPHAENTERΣ+√xΣ+LOGENTERSTO
  2. Choose AB with its menu key (the first one).

    Σ+
Result of the example "The STO prompt lists your variables on the menu keys" The display shows: y: 1.0000 / x: 2.0000.
You should seex: 2.0000

7.4Do arithmetic on a stored value#

Press + − × or ÷ straight after STO or RCL to combine instead of replace. STO+ adds X to the register. STO- subtracts X from it. RCL+ adds the register to X on the stack. RCL- gives X minus the register.

STO  ⊖:  R←R−XRCL  ⊖:  X←X−R\text{STO}\;\ominus:\; R\leftarrow R-X \qquad \text{RCL}\;\ominus:\; X\leftarrow X-R
Example 7.4

Add to a register

  1. Store 5 in register 01, then add 3 to it with STO+.

    5STO013STO+01
  2. Recall to check.

    RCL01
Result of the example "Add to a register" The display shows: y: 3.0000 / x: 8.0000.
You should seex: 8.0000
Example 7.5

Multiply a register

  1. Store 5, then multiply it by 3.

    5STO013STO×01RCL01
Result of the example "Multiply a register" The display shows: y: 3.0000 / x: 15.0000.
You should seex: 15.0000
Example 7.6

Subtract from a register

  1. Register 5, subtract 3: 2.

    5STO013STO−01RCL01
Result of the example "Subtract from a register" The display shows: y: 3.0000 / x: 2.0000.
You should seex: 2.0000
Example 7.7

Divide a register

  1. Register 5 divided by 3.

    5STO013STO÷01RCL01
Result of the example "Divide a register" The display shows: y: 3.0000 / x: 1.6667.
You should seex: 1.6667
Example 7.8

Recall with arithmetic: X plus a register

  1. Store 5 in 01, type 3, then RCL+ 01: 3 + 5.

    5STO013RCL+01
Result of the example "Recall with arithmetic: X plus a register" The display shows: y: 5.0000 / x: 8.0000.
You should seex: 8.0000
Example 7.9

Recall with subtraction: X minus a register

  1. 3 minus 5.

    5STO013RCL−01
Result of the example "Recall with subtraction: X minus a register" The display shows: y: 5.0000 / x: -2.0000.
You should seex: -2.0000

7.5Store into and recall from a stack level#

At the STO or RCL prompt press . to choose a stack level: the menu shows L (LASTx), X, Y, Z and T. This is a quick way to copy a stack value without rolling.

The ST prompt: choose a stack level with the top-row keys. The display shows: STO ST _ /  L   X   Y   Z   T     .
The ST prompt: choose a stack level with the top-row keys.
Example 7.10

Recall Y into X

  1. Fill the stack 5, 6, 7, then press RCL, the point key, and the Y menu key (third).

    5ENTER6ENTER7RCL.√x
Result of the example "Recall Y into X" The display shows: y: 7.0000 / x: 6.0000.
You should seex: 6.0000

7.6Browse your variables in the CATALOG#

Shift + opens the CATALOG. Its page has PGM (program labels), RL (real variables), CPX (complex variables) and MAT (matrices). Press one of them to list your names on the menu keys. Pressing a variable name recalls it; pressing a program label runs it.

The CATALOG menu. The display shows: x: 0.0000 /     PGM  RL CPX MAT    .
The CATALOG menu.
Example 7.11

Recall a real variable from the catalog

  1. Store 8 as variable BB.

    8STO⇧ALPHAENTERΣ+1/xΣ+1/xENTER
  2. Open the CATALOG and choose RL (third key), then BB.

    ⇧CATALOG+√xΣ+
Result of the example "Recall a real variable from the catalog" The display shows: x: 8.0000 /  BB                    .
You should seex: 8.0000

7.7Clear registers, variables and statistics#

The CLEAR menu (shift ←) page 1 has CLΣ (statistics), CLP (a program), CLV (a variable), CST (the stack), CLA (the ALPHA register) and CLX. Page 2 has CRG, which clears all numbered registers.

Example 7.12

Clear all registers

  1. Store 5 in register 01. Open CLEAR, press down, then CRG.

    5STO01⇧CLEAR←▼Σ+EXIT
  2. Recall register 01: it is zero again.

    RCL01
Result of the example "Clear all registers" The display shows: y: 5.0000 / x: 0.0000.
You should seex: 0.0000
Example 7.13

Delete a variable

  1. Store 7 in variable QQ, then CLEAR, CLV and choose QQ.

    7STO⇧ALPHAENTERLOGLOGLOGLOGENTER⇧CLEAR←√xΣ+EXIT
  2. Recalling it now fails.

    RCL⇧ALPHAENTERLOGLOGLOGLOGENTER
Result of the example "Delete a variable" The display shows: Nonexistent / x: 7.0000.
You should seeNonexistent

HP-42S is a trademark of HP Inc.. Trident Calculator is an independent product by South View Studios and is not affiliated with, sponsored by or endorsed by HP. The name is used only to describe the kind of calculator this model resembles; Trident's names, keys, display, fonts and software are its own clean-room design.