What is the difference between RCR and ROR?

Foo picture Foo · May 1, 2012 · Viewed 18.9k times · Source

I understand the from the terms that RCR would rotate the bit from the right to left, taking the bit from the carry while ROR will rotate the bit from right to left, taking the bit from the right but is that the only difference between them? If this is so, both of the instructions seem to do the same work. Please help out. Thanks

Answer

Paul R picture Paul R · May 1, 2012

RCR includes the carry flag in the rotation, so it's effectively an N+1 bit rotate, whereas ROR does not include the carry flag, so it's just an N bit rotate.

Some nice diagrams from www.c-jump.com:

enter image description here

enter image description here