HP -16C Owner's Handbook Manual page 93

Table of Contents

Advertisement

Section 9: Program Branching and Controls
91
The following program sums all the bits in the bit pattern in a
given storage register, yielding a checksum. The contents of
storage registers R, through R, are sequentially checksummed. As
the bits are summed, they are added to the updated, double-sized
checksum being held in registers Y and Z. This is what the stack
contains just before line 012:
T
2
Current checksum: most significant word.
Y
Current checksum: least significant word.
X
Number whose bits will be summed and added to
the current double-word contents in Y and Z.
The resulting checksum will be placed in registers X and Y.
This program uses
to decrement a register pointer in the
Index register and to control conditional loop branching.
Keystrokes
Display
(a][P/R]
000-
CLEAR
000-
[g)[L8] D
001-43,22, d
(f]SETCOMPL[UNSGN] 002-
42
3
Unsigned mode for
adding bits.
4
003-
4
004-
4244
Word size four bits.
005-
23
A
006-
A
007-
44 32
Stores number of top
register (R,) in R;.
0
008-
0
009-
36
Initializes checksum
to 0.
(g](LBL]O
010-43,22, 0
Start of summing loop.
(Enables stack lift.)
(RCL]((i)]
011-
4531
Recalls contents of
current register whose
numberis stored in R;.

Advertisement

Table of Contents
loading

Table of Contents