Hey, I'm new to this forum... Greetings, hope someone can help:
Imagine the code as follows, in MASM:
.686
.MODEL flat, stdcall
.CODE
PUBLIC testme
testme PROC, paraone:dword, paratwo: dword
;some code in here
ret
testme ENDP
When I assemble and link, and open the exe in a disassembler, I find...
PUSH EBP
MOV EBP,ESP
; some code here
LEAVE
RETN 8
Now my question:
Can I override MASM's handling of the ENTER/LEAVE for the procedure? I don't want EBP touched; I will manually access the parameters via the ESP.
I don't really like MASM "intelligent" asm code insertions... Is there documentation that shows what MASM is doing/inserting (not only for the PROC case, but in all cases)...?
Thanks for the time. Hope you can help.
Imagine the code as follows, in MASM:
.686
.MODEL flat, stdcall
.CODE
PUBLIC testme
testme PROC, paraone:dword, paratwo: dword
;some code in here
ret
testme ENDP
When I assemble and link, and open the exe in a disassembler, I find...
PUSH EBP
MOV EBP,ESP
; some code here
LEAVE
RETN 8
Now my question:
Can I override MASM's handling of the ENTER/LEAVE for the procedure? I don't want EBP touched; I will manually access the parameters via the ESP.
I don't really like MASM "intelligent" asm code insertions... Is there documentation that shows what MASM is doing/inserting (not only for the PROC case, but in all cases)...?
Thanks for the time. Hope you can help.
Turn it off:
OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE
Turn it on:
OPTION PROLOGUE:DEFAULTOPTION
OPTION EPILOGUE:DEFAULTOPTION
I turn it off at the begining of my program. :) OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE
MyOwnCode PROC P1:DWORD
; you can't use [b]P1[/b] here because MASM still
; pretends there is a stack frame. instead make
; your own names or use [ESP+4].
MyOwnCodeParm1 EQU <[esp+4]>
mov eax,MyOwnCodeParm1
ret
MyOwnCode ENDP