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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24594 Rev. 3.10 February 2005 AMD64 TechnologyROLRotate LeftRotates the bits of a register or memory location (first oper<strong>and</strong>) to the left (toward themore 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 left arerotated back in at the right end (lsb) 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, it masksthe upper two bits of the count, providing a count in the range of 0 to 63.After completing the rotation, the instruction sets the CF flag to the last bit rotatedout (the lsb of the result). For 1-bit rotates, the instruction sets the OF flag to theexclusive OR of the CF bit (after the rotate) <strong>and</strong> the most significant bit of the result.When the rotate count is greater than 1, the OF flag is undefined. When the rotatecount is 0, no flags are affected.Mnemonic Opcode DescriptionROL reg/mem8, 1 D0 /0 Rotate an 8-bit register or memory oper<strong>and</strong> left 1 bit.ROL reg/mem8, CL D2 /0ROL reg/mem8, imm8C0 /0 ibRotate an 8-bit register or memory oper<strong>and</strong> left the number ofbits specified in the CL register.Rotate an 8-bit register or memory oper<strong>and</strong> left the number ofbits specified by an 8-bit immediate value.ROL reg/mem16, 1 D1 /0 Rotate a 16-bit register or memory oper<strong>and</strong> left 1 bit.ROL reg/mem16, CL D3 /0ROL reg/mem16, imm8C1 /0 ibRotate a 16-bit register or memory oper<strong>and</strong> left the number ofbits specified in the CL register.Rotate a 16-bit register or memory oper<strong>and</strong> left the number ofbits specified by an 8-bit immediate value.ROL reg/mem32, 1 D1 /0 Rotate a 32-bit register or memory oper<strong>and</strong> left 1 bit.ROL reg/mem32, CL D3 /0ROL reg/mem32, imm8C1 /0 ibRotate a 32-bit register or memory oper<strong>and</strong> left the number ofbits specified in the CL register.Rotate a 32-bit register or memory oper<strong>and</strong> left the number ofbits specified by an 8-bit immediate value.ROL reg/mem64, 1 D1 /0 Rotate a 64-bit register or memory oper<strong>and</strong> left 1 bit.ROL 251

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

Saved successfully!

Ooh no, something went wrong!