under masm, the PROC reserved word create a stack frame using PUSH EBP/ MOV EBP,ESP / SUB ESP

there is any way to make PROC generate it using the ENTER instruction?

Posted on 2002-04-19 22:11:55 by ancev
Well use TASM? it looks to me like TASM uses ENTERD :)

now i remember that MASM has something called EPILOGUS/PROLOGUE code? but i am not sure since i have not been using MASM a lot lately ...

like one of great C++ coders commented :

/* i could have done this real divide only once above the loop
and place it in a temp variable but i think a 32 bit memory read
[b] is much slower [/b] than a FPU accelerated division */

at least he say " i think" ... the same with me "i remember" :stupid:
Posted on 2002-04-19 22:42:39 by BogdanOntanu
Yes, create your own EPILOGUE/PROLOGUE macros:

I have played with a version that allows up to 2MB of local
data on the stack, and the above link is for profiling PROCs.

He he he...posted at same time as BogdanOntanu.
Posted on 2002-04-19 22:42:54 by bitRAKE

yeah, you're right... i am trying to give a chance to masm32, but is impossible. tasm and nasm are better. masm dont let me control te code.

only good point that masm have are the includes.


ps: the irc help in #win32asm is really terrible :(

pps: bitrake, thanks. was that i was searching :)
Posted on 2002-04-20 00:21:52 by ancev

If you want to use the ENTER/LEAVE pair for a stack frame, I think you have to code it manually.

It may be worth trying a macro to do it which can probably be made to work with STDCALL but it would be difficult with a C calling convention as you need to know the parameter size to clean up the end.


Posted on 2002-04-20 02:05:16 by hutch--

ps: the irc help in #win32asm is really terrible :(
But the help here is good, no?

Hutch, it is the RET instruction which corrects for the parameters pushed on the stack - not ENTER/LEAVE. There should be no problem creating a macro for all calling conventions. MASM gives the EPILOGUE macro the number of bytes pushed on the stack for the RET instruction to clean up, or not. Using PROLOGUE/EPILOGUE macros doesn't effect the clean up after the invoke of a C PROC, it only effects code generation of the PROC. Or, maybe I don't understand what your saying?
Posted on 2002-04-20 14:30:38 by bitRAKE

here's excellent :)

Posted on 2002-04-21 10:30:55 by ancev