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
Rotate With Carry Right (rcr)
Operation. ROR provides the value of the contents of a register rotated by a value. The bits that are rotated off the right end are inserted into the vacated bit positions on the left.
The RCL (Rotate and Carry Left) instruction shifts each bit to the left, copies the Carry flag to the least significant bit and copies the most significant bit into the Carry flag.
The RCL and RCR instructions include the CF flag in the rotation. The RCL instruction shifts the CF flag into the least-significant bit and shifts the most-significant bit into the CF flag.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With