The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: sw337 on September 13, 2006, 10:59:04 AM

Title: should i ENTER ?
Post by: sw337 on September 13, 2006, 10:59:04 AM
 :eek

Please tell me if should use ENTER instruction every where or the
expanded version i.e. push ebp mov   ebp, esp  sub esp, 4
is better ?

Thanks.
Title: Re: should i ENTER ?
Post by: gabor on September 13, 2006, 03:20:46 PM
Hello!

What different would it make to use the "expanded version"?
Would it be faster? Well, maybe. This could be checked by a simple test app.

ASFAIK masm is not using the ENTER instruction, it uses the equivalent set of instructions instead.
If you use masm's invoke method you don't have to bother with entering a procedure and creating the local stack.

Greets, Gábor
Title: Re: should i ENTER ?
Post by: raymond on September 14, 2006, 01:37:13 AM
Quote from: gabor on September 13, 2006, 03:20:46 PM
If you use masm's invoke method you don't have to bother with entering a procedure and creating the local stack.

MASM's invoke is a "macro" strictly designed to push the given parameters on the stack and issuing the "call" to a procedure. It has NOTHING to do with any of the called procedures themselves.
Title: Re: should i ENTER ?
Post by: gabor on September 14, 2006, 09:54:19 AM
Hi!

That's right what raymond wrote, I made a mistake. About local variables there is the LOCAL keyword. The point I wanted to tell was that according to my experiences masm's possibilities make local variables to handle with ease.

Greets, Gábor