Re: A86: Assembly Functions (RL, RR)
[Prev][Next][Index][Thread]
Re: A86: Assembly Functions (RL, RR)
On Wed, 10 Sep 1997, Ricci Adams wrote:
>
> Could somebody please explain the math behind the RL, RR, RLC, ect
> assembly functions. I don't get it :) The only ones I get are SLA and SRA :)
>
RL is like SLA, except that the carry flag gets shifted into bit 0 of the
operand. RR goes the opposite direction. Here's a diagram:
Rotate Left (RL)
+------------------------------------------+
| |
+---+ +---+---+---+---+---+---+---+---+ |
| C |<---| 7 6 5 4 3 2 1 0 |<--+
+---+ +---+---+---+---+---+---+---+---+
RLC is like RL, except that bit 7 gets shifted into bit 0 of the operand.
RRC goes the opposite direction. Here's a diagram:
Rotate Left Through Carry Flag (RLC)
+-------------------------------------+
| |
+---+ | +---+---+---+---+---+---+---+---+ |
| C |<-+-| 7 6 5 4 3 2 1 0 |<--+
+---+ +---+---+---+---+---+---+---+---+
--------
Dan Eble (mailto:eble@cis.ohio-state.edu)
(http://www.cis.ohio-state.edu/~eble)
References: