HP -10C Owner's Handbook Manual page 80

Hide thumbs Also See for HP-10C:
Table of Contents

Advertisement

78
Section 6: Branching and Looping
We'll key the amount of the sale into the display before running the program so
that it will be in the X-register before the l0 instruction in program line 01
is executed. This instruction will place the test value (1,000) in the X-register
(the display) and move the sale amount into the Y-register. The ®
instruction in program line 02 will exchange the numbers in the X- and Y-
registers: that is, it will place the sales figure back into the X-register and place
the test value into the Y-register. This is necessary because when either the
l2 instruction in line 05 or the l1 instruction in line 07 is executed, the
number in the X-register is moved into the Y-register; if the. ® instruction
were not included, the test value (1,000) rather than the sale amount would be in
the Y-register when the k instruction in line 08 is executed.
Keystrokes
¥
´CLEARM
l0
®
´£
Display
00-
00-
01-
45
0
02-
34
03-
42 10
Recalls test value
(1,000) into X-register.
Places sale amount
(which you will key in
prior to running the
program) into X-register
and test value into Y-
register.
Tests whether number in
X-register (sale) is less
than or equal to number
in Y-register (1,000).

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents