Array-Type Memories - LEXIBOOK GC500i Instruction Manual

Graphic calculator
Table of Contents

Advertisement

In the case of P1, the result of P9 needs no further modification and so is immediately displayed upon return
to P1.
Calculation of the volumes is also performed in a similar manner. After a jump is made to P8 for
calculation, execution returns to the main routines. In P0, the program ends after the volume of the
octahedron is displayed. In P1, however, the result calculated in P8 is divided by four to obtain the
volume of the tetrahedron. By using subroutines in this manner, steps can be shortened and programs
become neat and easy to read.
The following illustration shows the flow of the program just presented.
P0
By isolating the common portions of the two original programs and storing them in separate program areas,
steps are shortened and programs take on a clear configuration.

4.8 ARRAY-TYPE MEMORIES

4.8.1 Using array-type memories
Up to this point all of the memories used have been referred to by single alphabetic characters such as A,
B, X, or Y. With the array-type memory introduced here, a memory here, a memory name (one alphabetic
character from A through Z) is appended with a subscript such as [1] or [2].
*** Brackets are input by
Standard memory
Proper utilization of subscripts shortens programs and makes them easier to use. Negative values used as
subscripts are counted in relation to memory zero as shown above.
Example: Input the numbers 1 through 10 into memories A through J.
Using standard memories
1, →, A, :, 2, →, B, :, 3, →, C, :, 4, →, D, :,
5, →, E, :, 6, →, F, :, 7, →, G, :, 8, →, H, :,
9, →, l, :, 1, 0, →, J
using array-type memories
0, →, Z, :, Lbl, 1, :, Z, +, 1, →, A, [, Z, ], :,
Isz, Z, :, Z, <, 1, 0, fi, Goto, 1
In the case of using standard memories, inputting values into memories one by one is both inefficient and
time consuming. What happens if we want to see a value stored in a specific memory.
Using standard memories
Lbl, 1, :, ?, →, Z, :,
Z, =, 1, fi, A,
, Z, =, 2, fi, B,
Z, =, 3, fi, C,
,Z, =, 4, fi, D,
Z, =, 5, fi, E,
, Z, =, 6, fi, F,
Z, =, 7, fi, G,
, Z, =, 8, fi, H,
Z, =, 9, fi, I,
, Z, =, 1, 0, fi, J,
Goto, 1
Copyright L
2002
EXIBOOK
P9
and
.
[
]
ALPHA
ALPHA
Array-type memory
A
A[0] C[-2]
B
A[1] C[-1]
C
A[2] C[0]
D
A[3] C[1]
E
A[4] C[2]
,
,
,
,
,
P1
40 steps
26 steps
70 steps
- 61 -
GB

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gc1000i

Table of Contents