Intel 253666-024US Computer Hardware User Manual


 
Vol. 2A 3-93
INSTRUCTION SET REFERENCE, A-M
CALL—Call Procedure
Note that when using a call gate to perform a far call to a segment at the same priv-
ilege level, an implicit stack switch occurs as a result of entering 64-bit mode. The SS
selector is unchanged, but stack segment accesses use a segment base of 0x0, the
limit is ignored, and the default stack size is 64-bits. (The full value of RSP is used for
the offset.) On the new stack, the processor pushes the segment selector and stack
pointer for the calling procedure’s stack and the segment selector and instruction
pointer for the calling procedure’s code segment. (Parameter copy is not supported in
IA-32e mode.) Finally, the processor branches to the address of the procedure being
called within the new code segment.
Operation
IF near call
THEN IF near relative call
THEN
IF OperandSize
= 64
THEN
tempDEST SignExtend(DEST); (* DEST is rel32 *)
tempRIP RIP + tempDEST;
IF stack not large enough for a 8-byte return address
THEN #SS(0); FI;
Push(RIP);
RIP tempRIP;
FI;
IF OperandSize
= 32
THEN
tempEIP EIP + DEST; (* DEST is rel32 *)
IF tempEIP is not within code segment limit THEN #GP(0); FI;
IF stack not large enough for a 4-byte return address
THEN #SS(0); FI;
Push(EIP);
EIP tempEIP;
FI;
IF OperandSize = 16
THEN
tempEIP (EIP + DEST) AND 0000FFFFH; (* DEST is rel16 *)
IF tempEIP is not within code segment limit THEN #GP(0); FI;
IF stack not large enough for a 2-byte return address
THEN #SS(0); FI;
Push(IP);
EIP tempEIP;
FI;
ELSE (* Near absolute call *)
IF OperandSize
= 64