The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Tight_Coder_Ex on November 28, 2007, 03:04:28 AM

Title: Can MASM be cohersed to use ENTER
Post by: Tight_Coder_Ex on November 28, 2007, 03:04:28 AM
I have a library routine for nullifying procedure frames nested or otherwise, but depend on ENTER rather than the conventional
        push ebp
        mov  ebp, esp
        add   esp, -40

Can MASM be coerced into using ENTER?
Title: Re: Can MASM be cohersed to use ENTER
Post by: MichaelW on November 28, 2007, 10:19:28 AM
If you are asking for a way to force MASM to use ENTER automatically, you should be able to modify an existing prologue macro to use ENTER, and then use that one in place of the default.

OPTION PROLOGUE:macroname
; code that uses new prologue here
OPTION PROLOGUE:PrologueDef
; back to using the default prologue


Zooba posted a stack probing prologue macro  here (http://www.masm32.com/board/index.php?topic=5252.0), based on a similar macro by chep  here (http://www.masm32.com/board/index.php?topic=2011.0). For the details, see User-Defined Prologue and Epilog Code, in Chapter 7 of the MASM Programmer’s Guide, available  here (http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_07.htm).

Title: Re: Can MASM be cohersed to use ENTER
Post by: zooba on November 28, 2007, 11:34:57 AM
I have also posted very basic macros for both prologue and epilogue on the OPTION (http://msdn2.microsoft.com/en-us/library/4zc781yh(VS.80).aspx) page at MSDN. They are probably an easier starting point than the stack probing version.

Cheers,

Zooba :U
Title: Re: Can MASM be cohersed to use ENTER
Post by: Tight_Coder_Ex on November 28, 2007, 12:27:31 PM
 :thumbu Excellent.

I guess it's time I studied the full potential of macros.  NASM has been my mainstay and it's macro capabilities are not as extensive.  For that reason I have developed the habit of coding in what is commonly termed pure assembly.

Thanks for the input, very valuable links and info
Title: Re: Can MASM be cohersed to use ENTER
Post by: Tedd on November 28, 2007, 01:44:23 PM
Quote from: Tight_Coder_Ex on November 28, 2007, 12:27:31 PM
NASM has been my mainstay and it's macro capabilities are not as extensive.
I would have to disagree there - you can do a lot more with nasm's macro capabilities. Although pre-canned utility is not supplied by default, so you generally have to write your own; that said there are a number of packages available, so you don't even need to do that.
Title: Re: Can MASM be cohersed to use ENTER
Post by: Vortex on November 30, 2007, 07:34:52 PM
Tight_Coder_Ex,

Nasm V2.00 is newly released :

http://nasm.sourceforge.net