News:

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

change LOCAL stack pointer!

Started by LAS3R, August 10, 2006, 09:47:32 PM

Previous topic - Next topic

LAS3R

I noticed that masm use ebp instead of esp when offset to LOCAL is used but in my prog i use ebp also so is there anyway i can change ebp to esp instead?

for ex:


LOCAL Hash1:DWORD

mov dword ptr [Hash1], eax <-- this will for ex turn into "mov dword ptr [ebp-4], eax" , but i want "mov dword ptr [esp-4], eax" instead, is it possible to change masm behavior?

since i use ebp register it will crash when it reach that line, which kind of annoying, and yes i need all registers ;)

GregL

LAS3R,

Eliminate the stack frame with OPTION PROLOGUE:NONE and OPTION EPILOGUE:NONE and write it your way. Here is an example, it is StrLen from the MASM32 Library. Also read the post below it by Tedd.

http://www.masm32.com/board/index.php?topic=4629.msg34442#msg34442


LAS3R


Petroizki

When you eliminate the stack frame, you have to make all the local pointers manually (you can't use the keyword Hash1 anymore).

I created my "pmacros" to free-up the ebp register used by MASM's stack frame. You might want to check it out, it might be little confusing and stupid to use these macros at first, but trust me, it's much simpler than manually making the esp pointing.

http://www.masm32.com/board/index.php?topic=1063.0