Skip to content

Register Operations

brickpool edited this page Apr 7, 2020 · 7 revisions

Register Operations

In the following eighteen routines, x, y, z, t and rk denote the contents of registers X, Y, Z, T and Rk, respectively. (k = A, B, …, Z)

1 Clear stack; retain all storage registers

xyzt → 0000

    _.----> lost
t -'_|  .-> T
z -'_|  |-> Z
y -' /  /-> Y
x --'  /--> X
0 ----'
LINE DATA OPERATIONS DISPLAY REMARKS
1 CLEAR 5'STK

2 Delete x

(Lower the stack.)

xyzt → YZTT

t ------.-> T
z ---._ '-> Z
y --._ '--> Y
x -._ '---> X
     '----> lost
LINE DATA OPERATIONS DISPLAY REMARKS
1 CLEAR 1'X +

3 Delete y

(Lower that part of the stack above X.)

xyzt → XZTT

t ------.-> T
z ---._ '-> Z
y --._ '--> Y
x ----)---> X
      '---> lost
LINE DATA OPERATIONS DISPLAY REMARKS
1 x<>y CLEAR 1'X +

4 Reverse the stack

xyzt → TZYX

t --.  .--> T
z --.\/.--> Z
y --'/\'--> Y
x --'  '--> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 x<>y R↓ R↓ x<>y

5 Fetch t or roll up

(Bring t to X, keeping the other operands in the same order).

xyzt → TXYZ

t -.   .---> T
z --\-' .--> Z
y ---\-' .-> Y
x ----\-'
       '---> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 R↑

6 Fetch t to Y

(Bring t to Y, keeping the other operands in the same order).

xyzt → XZTY

t -.   .--> T
z --\-' .-> Z
y ---\-'
      '---> Y
x --------> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 R↑ x<>y

7 Fetch z

(Bring z to X, keeping the other operands in the same order).

xyzt → YZXT

t --------> T
z -.   .--> Z
y --\-' .-> Y
x ---\-'
      '---> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 R↓ R↓ x<>y R↓

8 Copy x into Z and T

xyzt → XYXX

    __.---> lost
t -' /  .-> T
z --'  /--> Z
y ----/---> Y
x ---'
LINE DATA OPERATIONS DISPLAY REMARKS
1 ENTER ENTER R↓ R↓

9 Copy y into Z

(T is cleared).

xyzt → XYY0

0 ----.
    _.-\--> lost
t -' |  '-> T
z --'  .--> Z
y ----'---> Y
x --------> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 ENTER ENTER - R↓

10 Copy y into Z and T

xyzt → XYYY

    __.---> lost
t -' /  .-> T
z --'  /--> Z
y ----'---> Y
x --------> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 x<>y ENTER ENTER R↑

11 Copy y and x into Z and T, respectively

(Copy x and y in the reverse stack order, but this is the shortest way to save x and y in the stack).

xyzt → XYYX

    __.---> lost
t -' / .--> T
z --' / .-> Z
y ---/-'--> Y
x --'-----> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 ENTER ENTER CLEAR 1'X
2 + R↓

12 Copy y and x into T and Z, respectively

(Copy x and y in the same stack order to Z and T).

xyzt → XYXY

    __.---> lost
t -' / .--> T
z --' / .-> Z
y ---'-/--> Y
x ----'---> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 ENTER ENTER R↑ ENTER
2 R↓ x<>y

13a Swap x and rk (z into T)

(Exchange x and rk, t is lost), where k = A, B, …, Z.

xyzt → RYZZ

     _.---> lost
t --'  .--> T
z ----'---> Z
y --------> Y
x ---._.--> X
rk --' '--> Rk
LINE DATA OPERATIONS DISPLAY REMARKS
1 RCL k is an alpha and
2 k x<>y STO A ≤ k ≤ Z
3 k CLEAR 1'X +

13b Swap x and rk

(Exchange x and rk, t is retained), where k = A, B, …, Z.

xyzt → RYZT

t --------> T
z --------> Z
y --------> Y
x ---._.--> X
rk --' '--> Rk
LINE DATA OPERATIONS DISPLAY REMARKS
1 x≶ k is an alpha and
2 k A ≤ k ≤ Z

14 Swap y and z

xyzt → XZYT

t --------> T
z ---._.--> Z
y ---' '--> Y
x --------> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 R↓ x<>y R↑

15 Swap z and t

xyzt → XYTZ

t ---._.--> T
z ---' '--> Z
y --------> Y
x --------> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 R↓ R↓ x<>y R↓ R↓

16 Swap x and t

xyzt → TYZX

t --.   .--> T
z ---\-/---> Z
y ---/-\---> Y
x --'   '--> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 R↓ R↓ x<>y R↓ R↓

17 Swap x and z

(Reverse contents of X, Y, Z)

xyzt → ZYXT

t ---------> T
z --.   .--> Z
y --->-<---> Y
x --'   '--> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 x<>y R↓ R↓ x<>y R↓

18 Swap y and t

(Reverse contents of Y, Z, T)

xyzt → ZYXT

t --.   .--> T
z --->-<---> Z
y --'   '--> Y
x ---------> X
LINE DATA OPERATIONS DISPLAY REMARKS
1 R↓ x<>y R↓ R↓ x<>y

Clone this wiki locally