beautypg.com

Manipulating bits and bytes, Manipulating bits and bytes -6, O (base – HP 49g Graphing Calculator User Manual

Page 83: 0 (0e), Jbit, Byte

Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

background image

Manipulating bits and bytes

The following commands enable you to manipulate binaiy integers one bit

or one byte at a time. The commands are available by pressing

o (BASE

jbit

OR

0 (0E)

byte

.

Unless otherwise stated, each example assumes the

wordsize is set to 24.

Commands

Example

Input

Output

ASR

Arithmetic Shift Right. Per­

forms 1 bit arithmetic right shift.
The most significant bit is regener­

ated.

#1100010b

#110001b

RL

Rotate Left. Binary integer

rotates left one bit. (The example
assumes that the wordsize is 4.)

# 1100b

# 1001b

RLE

Rotate Left Byte. Binary inte­

ger rotates left one byte.

# FFFFh

# FFFFOOh

RR Rotate Right. Binary integer

rotates right one bit. (The example

assumes that the wordsize is 4.)

# 1101b

#1110b

RRB Rotate Right Byte.
Binary integer rotates right one
byte.

# AOBOCOh

COAOBOh

SL Shift Left. Binary integer shifts
left one bit.

# 1101b

#11010b

SLB

Shift Left Byte. Binary integer

shifts left one byte.

# AOBOh

# AOBOOOh

SR Shift Right. Binary integer

shifts right one bit.

# l l O l l b

# 1101b

SRB

Shift Right Byte. Binary inte­

ger shifts right one byte.

# AOBOCOh

# AOBOh

Page 8-6

Number bases