13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24594 Rev. 3.10 February 2005 AMD64 TechnologyRORRotate RightRotates the bits of a register or memory location (first oper<strong>and</strong>) to the right (towardthe less significant bit positions) by the number of bit positions in an unsignedimmediate value or the CL register (second oper<strong>and</strong>). The bits rotated out right arerotated back in at the left end (the most significant bit) of the first oper<strong>and</strong> location.The processor masks the upper three bits of the count oper<strong>and</strong>, thus restricting thecount to a number between 0 <strong>and</strong> 31. When the destination is 64 bits wide, theprocessor masks the upper two bits of the count, providing a count in the range of 0 to63.After completing the rotation, the instruction sets the CF flag to the last bit rotatedout (the most significant bit of the result). For 1-bit rotates, the instruction sets the OFflag to the exclusive OR of the two most significant bits of the result. When the rotatecount is greater than 1, the OF flag is undefined. When the rotate count is 0, no flagsare affected.Mnemonic Opcode DescriptionROR reg/mem8, 1 D0 /1 Rotate an 8-bit register or memory location right 1 bit.ROR reg/mem8, CL D2 /1ROR reg/mem8, imm8C0 /1 ibRotate an 8-bit register or memory location right the number ofbits specified in the CL register.Rotate an 8-bit register or memory location right the number ofbits specified by an 8-bit immediate value.ROR reg/mem16, 1 D1 /1 Rotate a 16-bit register or memory location right 1 bit.ROR reg/mem16, CL D3 /1ROR reg/mem16, imm8C1 /1 ibRotate a 16-bit register or memory location right the number ofbits specified in the CL register.Rotate a 16-bit register or memory location right the number ofbits specified by an 8-bit immediate value.ROR reg/mem32, 1 D1 /1 Rotate a 32-bit register or memory location right 1 bit.ROR reg/mem32, CL D3 /1ROR reg/mem32, imm8C1 /1 ibRotate a 32-bit register or memory location right the number ofbits specified in the CL register.Rotate a 32-bit register or memory location right the number ofbits specified by an 8-bit immediate value.ROR reg/mem64, 1 D1 /1 Rotate a 64-bit register or memory location right 1 bit.ROR 253

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!