110 Section 10: The Index Register and Loop Control

For example, the number 0.05002 in a storage register represents:

nnnnnx x x y y

0.05 0 0 2

Start count at zero.

Count by twos.

Count up to 50.

I and e Operation. Each time a program encounters I or e it increments or decrements nnnnn (the integer portion of the loop control number), thereby keeping count of the loop iterations. It compares

nnnnnto xxx, the prescribed test value, and exits the loop by skipping the next line if the loop counter (nnnnn) is either greater than (I) or less than or equal to (e) the test value (xxx). The amount that nnnnn is incremented or decremented is specified by yy.

With these functions (as opposed to the other conditional tests), the rule is ―Skip if True‖.

False (nnnnn xxx)

loop

instruction

´IV

t.1

instruction

True (nnnnn > xxx)

exit loop

For I: given nnnnn.xxxyy, increment nnnnn to nnnnn + yy, compare it to xxx, and skip the next program line if the new value satisfies nnnnn > xxx. This allows you to exit a loop at this point when nnnnn becomes greater than xxx.

Page 110
Image 110
HP 15c Scientific manual Nnnnn x x x y y 5 0 0, Start count at zero Count by twos Count up to