LEXIBOOK GC500i Instruction Manual page 58

Graphic calculator
Table of Contents

Advertisement

GB
In this program, a 0 is first stored in memory B to clear it for calculation of the sum. Next, the value input
by "? I A" is stored in memory A by "A=0⇒" and it is determined whether or not the value stored in
memory A equals zero. If A=0, goto 2 causes execution to jump to Lbl 2. If memory A does not equal 0,
Goto then Goto 1 returns execution to Lbl 1.
Execution from Lbl 2 will display the sum that has been stored in memory B. Actually, the display
command "4" is inserted following B, but here it can be omitted.
The following illustration shows the flow of the program:
4.7.4 Count jumps
The count jumps cause the value in a specified memory to be increased or decreased by 1. If the value does
equal 0, the following statement is skipped, and the statement following the next ":" or "
The "Isz" command is used to increase the value in memory by 1 and decide the subsequent execution,
while the "Dsz" command is used to decrease the value by 1 and decide.
Isz
Dsz
Example:
Increase memory A by one ................... Isz A
Decrease memory B by one .................. Dsz B
1, 0, →, A, :, 0, →, C, :,
Program
Lbl, 1, :, ?, →,B, :, B, +, C, →, C, :,
Dsz, A, :, Goto, 1, :, C, ÷, 1, 0
In this program, first 10 is stored in memory A, and 0 is stored in memory C. Memory A is used as the
"counter" and countdown is performed the specified number of times by the Dsz command. Memory C is
used to store the sum of the inputs, and so first must be cleared by inputting 10. The numeric value input
in response to "?" is stored in memory B, and then the sum of the input values is stored in memory C by
"B+C → C".
The statement Dsz A then decreases the value stored in memory A by 1. If the result does not equal 0, the
following statement, Goto 1 is executed. If the result equals 0, the following Goto 1 is skipped and "C÷10"
is executed.
- 58 -
(A≠O)
Lbl 1 : ? →A
(A=O)
A = O ⇒ Gogo 2 : A+B →Β : Goto 1
(A≠O)
Lbl 2 :B
(A=O)
Memory contents h0
{
:
Memory name: Statement
Memory contents = 0
Memory contents ≠ 0
{
:
Memory name: Statement
Memory contents = 0
" is executed.
}
Statement
}
Statement
32 steps
Copyright L
EXIBOOK
2002

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gc1000i

Table of Contents