Re: LZ: Rotating


[Prev][Next][Index][Thread]

Re: LZ: Rotating



Alright, I know I'm gonna get carried away here, but...  ;)
This is kinda from Eric Linenberg's page.
======
Say we take a byte and number the bits A-H, where A is the most 
significant bit and H is the least significant bit.
We now have:


A B C D E F G H


Rotations that can be done:
------
Shift Left (SLA) = B C D E F G H 0


Logical Shift Right (SRL) = 0 A B C D E F G


Arithmetic Shift Right (SRA) = A A B C D E F G


Circular Rotate Left (RLC) = B C D E F G H A
Carry Flag = A


Circular Rotate Right (RRC) = H A B C D E F G
Carry Flag = H


Rotate Left (RL) = B C D E F G H c
Where "c" = Carry Flag before the operation
Carry Flag = A (after the operation)


Rotate Right (RR) = c A B C D E F G
Where "c" = Carry Flag before the operation
Carry Flag = H (after the operation)
======
That's all folks...  :)


____
~Keith
FFNP69C@PRODIGY.COM


References: