Rotating Bits - HP -16C Owner's Handbook Manual

Table of Contents

Advertisement

48
Section 4: Arithmetic and Bit Manipulation Functions
Keystrokes
Display
([STATUS]: 2-08-0000)
(f)]SHOW [DEC]
127 d
([ENTER]is not needed
because this function
terminates digit entry.)
00001111 b
Each shift performs an
integer divide by 2 and
sets flag 4 because a 1 is
shifted into the carry bit.
[fJSHOW [DEC] (hold)
15 d
(release)
00001111
b
10000000
10000000 b
SHOW
-128 d
[(9)[ASR] [¢)[ASR]
11100000 b
(g](AsR]
11110000 b
Sign bit is regenerated
and carry flag is cleared
with each shift.
SHOW
-16 d
(release)
11110000 b
Rotating Bits
There are three general types of rotate functions on the HP-16C,
encompassing eight different functions.
¢ Rotate left and right ([RL], [RR]).
¢ Rotate left and right "through the carry bit" ([RLC], [RRC)).
* Rotate n places ([RLn], [RRn], [RLCn], [RRCn]).
Rotation. Pressing
(rotate left) or
(rotate right)
causes the contents of the X-register to rotate (or "circularly shift")
one bit to the left or right. Bits shifted out of the word re-enter it at
the other end. The carry flag is set if a 1 bit is rotated around the
end, and is cleared if a zero is rotated around the end.
|:I<— [<
o
C
\/
| ——[]
C
I
\__/

Advertisement

Table of Contents
loading

Table of Contents