EasyManua.ls Logo

HP HP-10C - Page 80

HP HP-10C
122 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 Display
¥
00-
´CLEARM
00-
l0
01- 45 0
Recalls test value
(1,000) into X-register.
®
02- 34
Places sale amount
(which you will key in
prior to running the
program) into X-register
and test value into Y-
register.
´£
03- 42 10
Tests whether number in
X-register (sale) is less
than or equal to number
in Y-register (1,000).

Table of Contents

Related product manuals