Click to See Complete Forum and Search --> : About ror....


jimmyliao
June 20th, 2006, 09:19 PM
Dear all,

Do anyone see the following code segments :

...
ror eax
...

( Normally we see "ror eax, n" where n is the number.
But above code segments is ok and no error message when compiling...)

What is the default "number" for this kind of instruction ?

:blush:

Hobson
June 21st, 2006, 01:24 AM
Visual Studio 6 and 2003 inline assembler emits an error when trying to compile 'ror eax': error C2414: illegal number of operands. Intel Instruction Set Reference Manual also does not list this instruction in one-parameter form. But it is possible that when no other parameter specified, count of rotated or shifted bits should be put into CL register, since CL is treated like 'counter' for shift/rotate operations.

regards,
Hob

jimmyliao
June 21st, 2006, 01:39 AM
Thanks ! :)

olivthill
June 21st, 2006, 01:33 PM
Robert L. Hummel, in his excellent book "The Processor and Coprocessor" also says that there should be two operands.
But, if there is only one operand, I would rather think this is a rotation of one bit, instead of a rotation of the number of bits indicated by the CL register. But this is only a guess.