Here is my test code (Tested with JWASM and ML the "bloody beast" must be "GoASM":P):
.686p
.model flat,stdcall
option casemap :none ; case sensitive
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
; *********************************************************
; turn stackframe off and on for low overhead procedures
; *********************************************************
Stackframe MACRO arg
IFIDNI <on>,<arg>
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
ELSEIFIDNI <off>,<arg>
OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE
ELSE
echo -----------------------------------
echo ERROR IN "stackframe" MACRO
echo Incorrect Argument Supplied
echo Options
echo 1. off Turn default stack frame off
echo 2. on Restore stack frame defaults
echo SYNTAX : frame on/off
echo -----------------------------------
.err
ENDIF
ENDM
; ---------------------------------------------------------
Pilot PROTO
.data
CommandLine dd 0
hInstance dd 0
.code
start:
invoke GetModuleHandle, NULL ; provides the instance handle
mov hInstance, eax
invoke GetCommandLine ; provides the command line address
mov CommandLine, eax
invoke Pilot
invoke ExitProcess,eax
Stackframe off
ZeroSubVars proc public
mov eax, [esp+4]
mov ecx, dword ptr [eax+5]
.if (byte ptr [eax+4] == 0C4h)
neg ecx
.endif
.if (byte ptr [eax+3] == 83h)
movzx ecx, cl
.endif
mov edx, edi
mov edi, ecx
sub edi, ebp
neg edi
shr ecx, 2
xor eax, eax
rep stosd
mov edi, edx
ret 4
ZeroSubVars endp
Stackframe on
Pilot proc public
LOCAL MyVar :QWORD
push offset Pilot
call ZeroSubVars
ret 4
Pilot endp
end start