Volume 3: General-Purpose and System Instructions - Stanford ...
Volume 3: General-Purpose and System Instructions - Stanford ... Volume 3: General-Purpose and System Instructions - Stanford ...
AMD64 Technology 24594 Rev. 3.10 February 2005296 XOR
24594 Rev. 3.10 February 2005 AMD64 Technology4 System Instruction ReferenceThis chapter describes the function, mnemonic syntax, opcodes,affected flags, and possible exceptions generated by the systeminstructions. The system instructions are used to establish theoperating mode, access processor resources, handle programand system errors, and manage memory. Many of theseinstructions can only be executed by privileged software, suchas the operating system kernel and interrupt handlers, that runat the highest privilege level. Only system instructions canaccess certain processor resources, such as the control registers,model-specific registers, and debug registers.System instructions are supported in all hardwareimplementations of the AMD64 architecture, except that thefollowing system instructions are implemented only if theirassociated CPUID function bits are set:• RDMSR and WRMSR, indicated by bit 5 of CPUID standardfunction 1 or extended function 8000_0001h.• SYSENTER and SYSEXIT, indicated by bit 11 of CPUIDstandard function 1.• SYSCALL and SYSRET, indicated by bit 11 of CPUIDextended function 8000_0001h.• Long Mode instructions, indicated by bit 29 of CPUIDextended function 8000_0001h.There are also several other CPUID function bits that controlthe use of system resources and functions, such as pagingfunctions, virtual-mode extensions, machine-check exceptions,advanced programmable interrupt control (APIC), memorytyperange registers (MTRRs), etc. For details, see “ProcessorFeature Identification” in Volume 2.For further information about the system instructions andregister resources, see:• “System-Management Instructions” in Volume 2.• “Summary of Registers and Data Types” on page 30.• “Notation” on page 43.• “Instruction Prefixes” on page 3.297
- Page 276 and 277: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 278 and 279: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 280 and 281: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 282 and 283: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 284 and 285: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 286 and 287: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 288 and 289: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 290 and 291: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 292 and 293: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 294 and 295: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 296 and 297: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 298 and 299: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 300 and 301: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 302 and 303: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 304 and 305: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 306 and 307: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 308 and 309: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 310 and 311: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 312 and 313: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 314 and 315: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 316 and 317: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 318 and 319: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 320 and 321: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 322 and 323: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 324 and 325: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 328 and 329: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 330 and 331: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 332 and 333: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 334 and 335: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 336 and 337: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 338 and 339: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 340 and 341: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 342 and 343: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 344 and 345: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 346 and 347: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 348 and 349: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 350 and 351: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 352 and 353: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 354 and 355: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 356 and 357: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 358 and 359: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 360 and 361: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 362 and 363: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 364 and 365: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 366 and 367: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 368 and 369: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 370 and 371: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 372 and 373: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 374 and 375: AMD64 Technology 24594 Rev. 3.10 Fe
24594 Rev. 3.10 February 2005 AMD64 Technology4 <strong>System</strong> Instruction ReferenceThis chapter describes the function, mnemonic syntax, opcodes,affected flags, <strong>and</strong> possible exceptions generated by the systeminstructions. The system instructions are used to establish theoperating mode, access processor resources, h<strong>and</strong>le program<strong>and</strong> system errors, <strong>and</strong> manage memory. Many of theseinstructions can only be executed by privileged software, suchas the operating system kernel <strong>and</strong> interrupt h<strong>and</strong>lers, that runat the highest privilege level. Only system instructions canaccess certain processor resources, such as the control registers,model-specific registers, <strong>and</strong> debug registers.<strong>System</strong> instructions are supported in all hardwareimplementations of the AMD64 architecture, except that thefollowing system instructions are implemented only if theirassociated CPUID function bits are set:• RDMSR <strong>and</strong> WRMSR, indicated by bit 5 of CPUID st<strong>and</strong>ardfunction 1 or extended function 8000_0001h.• SYSENTER <strong>and</strong> SYSEXIT, indicated by bit 11 of CPUIDst<strong>and</strong>ard function 1.• SYSCALL <strong>and</strong> SYSRET, indicated by bit 11 of CPUIDextended function 8000_0001h.• Long Mode instructions, indicated by bit 29 of CPUIDextended function 8000_0001h.There are also several other CPUID function bits that controlthe use of system resources <strong>and</strong> functions, such as pagingfunctions, virtual-mode extensions, machine-check exceptions,advanced programmable interrupt control (APIC), memorytyperange registers (MTRRs), etc. For details, see “ProcessorFeature Identification” in <strong>Volume</strong> 2.For further information about the system instructions <strong>and</strong>register resources, see:• “<strong>System</strong>-Management <strong>Instructions</strong>” in <strong>Volume</strong> 2.• “Summary of Registers <strong>and</strong> Data Types” on page 30.• “Notation” on page 43.• “Instruction Prefixes” on page 3.297