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 TechnologyMOV(CRn)Move to/from Control RegistersMoves the contents of a 32-bit or 64-bit general-purpose register to a control registeror vice versa.In 64-bit mode, the oper<strong>and</strong> size is fixed at 64 bits without the need for a REX prefix.In non-64-bit mode, the oper<strong>and</strong> size is fixed at 32 bits <strong>and</strong> the upper 32 bits of thedestination are forced to 0.CR0 maintains the state of various control bits. CR2 <strong>and</strong> CR3 are used for pagetranslation. CR4 holds various feature enable bits. CR8 is used to prioritize externalinterrupts. CR1, CR5, CR6, CR7, <strong>and</strong> CR9 through CR15 are all reserved <strong>and</strong> raise anundefined opcode exception (#UD) if referenced.CR8 can also be read <strong>and</strong> modified using the task priority register described in“<strong>System</strong>-Control Registers” in <strong>Volume</strong> 2.CR8 can be read <strong>and</strong> written in 64-bit mode, using a REX prefix. CR8 can be read <strong>and</strong>written in legacy mode using the MOV (CRn) opcode, using a LOCK prefix instead of aREX prefix to specify the additional opcode bit. To verify whether the LOCK prefixcan be used in this way, check the status of ECX bit 4 returned by CPUID st<strong>and</strong>ardfunction 80000001h.This instruction is always treated as a register-to-register (MOD = 11) instruction,regardless of the encoding of the MOD field in the MODR/M byte.MOV(CRn) is a privileged instruction <strong>and</strong> must always be executed at CPL = 0.MOV (CRn) is a serializing instruction.Mnemonic Opcode DescriptionMOV CRn, reg32 0F 22 /r Move the contents of a 32-bit register to CRnMOV CRn, reg64 0F 22 /r Move the contents of a 64-bit register to CRnMOV reg32,CRn 0F 20 /r Move the contents of CRn to a 32-bit register.MOV reg64,CRn 0F 20 /r Move the contents of CRn to a 64-bit register.Note:CR0, CR2, CR3, CR4, <strong>and</strong> CR8 are the only registers to which this instruction applies. See text for details.MOV(CRn) 329

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

Saved successfully!

Ooh no, something went wrong!