please dont rip this site

Intel x86 Instruction ENTER

 ENTER Word    Byte	    11001000 word------------  byte--

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 proce-dure). 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. The ENTER instruction (when used) is typically the first instruction in a procedure and is used to set up a new stack frame for a procedure. The LEAVE instruction is then used at the end of the procedure (just before the RET instruction) to release the stack frame.

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. See “Procedure Calls for Block-Structured Languages” in Chapter 4 of the Intel Architecture Software Developer’s Manual, Volume 1, for more information about the actions of the ENTER instruction.

                                     Clocks                     Size
        Operands         808x    286       386       486        Bytes

        immed16,0         -       11       10         14          4
        immed16,1         -       15       12         17          4
        immed16,immed8    -   12+4(n-1) 15+4(n-1)    17+3n        4

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;

See also:


file: /Techref/intel/x86/inst/enters.htm, 3KB, , updated: 2007/11/20 16:20, local time: 2024/12/24 10:22, owner: JMN-EFP-786,
TOP NEW HELP FIND: 
18.118.166.45:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://linistepper.com/techref/intel/x86/inst/enters.htm"> Intel, x86 Processor, ENTER Instruction</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?