■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 “ J ” is executed. The “ Isz” command
is used to increase the value in memory by 1 and decide the subsequent execu
tion, while the “ Dsz” command is used to decrease the value by 1 and decide.
Memory contents ^0
Isz Memory1 name : Statement J I Statement
Memory contents = 0
Memory contents * 0
Dsz Memory1 name : Statement
{ . }
Statement
Memory contents = 0
Example Increase memory A by o ne
.............
Isz A
Decrease memory B by one
.............
Dsz B
Example Determine the average of 10 input numeric values.
Program
1 , 0, - , A, :, 0 , - , C, :,
Lbl, 1, ?, - , B, :, B, +, C, - , C, :,
Dsz, A, :, Goto, 1 , :, C, ^,1,0
32 steps
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 a 0. 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 “ Ch-1 0 ” is executed.
- 1 2 4 -