User Guide

General-Purpose Programming 67
24592—Rev. 3.15—November 2009 AMD64 Technology
The NOP instructions performs no operation (except incrementing the instruction pointer rIP by one).
It is an alternative mnemonic for the XCHG rAX, rAX instruction. Depending on the hardware
implementation, the NOP instruction may use one or more cycles of processor time.
3.3.18 System Calls
System Call and Return
SYSENTER—System Call
SYSEXIT—System Return
SYSCALL—Fast System Call
SYSRET—Fast System Return
The SYSENTER and SYSCALL instructions perform a call to a routine running at current privilege
level (CPL) 0—for example, a kernel procedure—from a user level program (CPL 3). The addresses of
the target procedure and (for SYSENTER) the target stack are specified implicitly through the model-
specific registers (MSRs). Control returns from the operating system to the caller when the operating
system executes a SYSEXIT or SYSRET instruction. SYSEXIT are SYSRET are privileged
instructions and thus can be issued only by a privilege-level-0 procedure.
The SYSENTER and SYSEXIT instructions form a complementary pair, as do SYSCALL and
SYSRET. SYSENTER and SYSEXIT are invalid in 64-bit mode. In this case, use the faster
SYSCALL and SYSRET instructions.
For details on these on other system-related instructions, see “System-Management Instructions” in
Volume 2 and “System Instruction Reference” in Volume 3.
3.4 General Rules for Instructions in 64-Bit Mode
This section provides details of the general-purpose instructions in 64-bit mode, and how they differ
from the same instructions in legacy and compatibility modes. The differences apply only to general-
purpose instructions. Most of them do not apply to 128-bit media, 64-bit media, or x87 floating-point
instructions.
3.4.1 Address Size
In 64-bit mode, the following rules apply to address size:
Defaults to 64 bits.
Can be overridden to 32 bits (by means of opcode prefix 67h).
Can’t be overridden to 16 bits.