3-159
INSTRUCTION SET REFERENCE
ENTERMake Stack Frame for Procedure Parameters (Continued)
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
IF StackSize = 32
EBP
<
EBP
?
4;
Push([EBP]); (* doubleword push *)
ELSE (* StackSize = 16*)
BP
<
BP
?
4;
Push([BP]); (* doubleword push *)
FI;
ELSE (* OperandSize = 16 *)
IF StackSize = 32
THEN
EBP
<
EBP
?
2;
Push([EBP]); (* word push *)
ELSE (* StackSize = 16*)
BP
<
BP
?
2;
Push([BP]); (* word push *)
FI;
FI;
OD;
IF OperandSize = 32
THEN
Push(FrameTemp); (* doubleword push *)
ELSE (* OperandSize = 16 *)
Push(FrameTemp); (* word push *)
FI;
GOTO CONTINUE;
FI;