News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Can MASM be cohersed to use ENTER

Started by Tight_Coder_Ex, November 28, 2007, 03:04:28 AM

Previous topic - Next topic

Tight_Coder_Ex

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?

MichaelW

#1
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, based on a similar macro by chep here. For the details, see User-Defined Prologue and Epilog Code, in Chapter 7 of the MASM Programmer’s Guide, available here.

eschew obfuscation

zooba

I have also posted very basic macros for both prologue and epilogue on the OPTION page at MSDN. They are probably an easier starting point than the stack probing version.

Cheers,

Zooba :U

Tight_Coder_Ex

 :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

Tedd

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.
No snowflake in an avalanche feels responsible.

Vortex