![Intel ITANIUM ARCHITECTURE Manual Download Page 101](http://html.mh-extra.com/html/intel/itanium-architecture/itanium-architecture_manual_2073403101.webp)
4:94
Volume 4: Base IA-32 Instruction Reference
ENTER—Make Stack Frame for Procedure Parameters
Description
Creates a stack frame for a procedure. The first operand (size operand) specifies the
size of the stack frame (that is, the number of bytes of dynamic storage allocated on
the stack for the procedure). The second operand (nesting level operand) gives the
lexical nesting level (0 to 31) of the procedure. The nesting level determines the
number of stack frame pointers that are copied into the “display area” of the new stack
frame from the preceding frame. Both of these operands are immediate values.
The stack-size attribute determines whether the BP (16 bits) or EBP (32 bits) register
specifies the current frame pointer and whether SP (16 bits) or ESP (32 bits) specifies
the stack pointer.
The ENTER and companion LEAVE instructions are provided to support block structured
languages. They do not provide a jump or call to another procedure; they merely set up
a new stack frame for an already called procedure. An ENTER instruction is commonly
followed by a CALL, JMP, or J
cc
instruction to transfer program control to the procedure
being called.
If the nesting level is 0, the processor pushes the frame pointer from the EBP register
onto the stack, copies the current stack pointer from the ESP register into the EBP
register, and loads the ESP register with the current stack-pointer value minus the value
in the size operand. For nesting levels of 1 or greater, the processor pushes additional
frame pointers on the stack before adjusting the stack pointer. These additional frame
pointers provide the called procedure with access points to other nested frames on the
stack.
Operation
NestingLevel
NestingLevel MOD 32
IF StackSize = 32
THEN
Push(EBP) ;
FrameTemp
ESP;
ELSE (* StackSize = 16*)
Push(BP);
FrameTemp
SP;
FI;
IF NestingLevel = 0
THEN GOTO CONTINUE;
FI;
IF (NestingLevel
0)
FOR i
1 TO (NestingLevel
1)
DO
IF OperandSize = 32
THEN
Opcode
Instruction
Description
C8
iw
00
ENTER
imm16
,0
Create a stack frame for a procedure
C8
iw
01
ENTER
imm16
,1
Create a nested stack frame for a procedure
C8
iw
ib
ENTER
imm16,imm8
Create a nested stack frame for a procedure
Summary of Contents for ITANIUM ARCHITECTURE
Page 1: ......
Page 7: ...402 Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 199: ...4 192 Volume 4 Base IA 32 Instruction Reference FWAIT Wait See entry for WAIT ...
Page 352: ...Volume 4 Base IA 32 Instruction Reference 4 345 ROL ROR Rotate See entry for RCL RCR ROL ROR ...
Page 589: ...4 582 Volume 4 IA 32 SSE Instruction Reference ...
Page 590: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 Index ...
Page 591: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 603: ...INDEX Index 12 Index for Volumes 1 2 3 and 4 ...
Page 604: ......