Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z

Vol. 2B 4-129
INSTRUCTION SET REFERENCE, N-Z
In 64-bit mode, using a REX prefix in the form of REX.R permits access to additional
registers (R8-R15). When in 64-bit mode, POPs using 32-bit operands are not encod-
able and POPs to DS, ES, SS are not valid. See the summary chart at the beginning
of this section for encoding data and limits.
Operation
IF StackAddrSize = 32
THEN
IF OperandSize
= 32
THEN
DEST SS:ESP; (* Copy a doubleword *)
ESP ESP + 4;
ELSE (* OperandSize
= 16*)
DEST SS:ESP; (* Copy a word *)
ESP ESP + 2;
FI;
ELSE IF StackAddrSize
= 64
THEN
IF OperandSize
= 64
THEN
DEST SS:RSP; (* Copy quadword *)
RSP RSP + 8;
ELSE (* OperandSize
= 16*)
DEST SS:RSP; (* Copy a word *)
RSP RSP + 2;
FI;
FI;
ELSE StackAddrSize
= 16
THEN
IF OperandSize
= 16
THEN
DEST SS:SP; (* Copy a word *)
SP SP + 2;
ELSE (* OperandSize
= 32 *)
DEST SS:SP; (* Copy a doubleword *)
SP SP + 4;
FI;
FI;
Loading a segment register while in protected mode results in special actions, as
described in the following listing. These checks are performed on the segment
selector and the segment descriptor it points to.