@Proc text equate
Brought to you by:
japheth
"@Proc" (or similar name) text equate to be used in debugging/debug builds.
Like for instance:
%invoke _assert,T(exptxt),T("@FileCur"),@Line,T(@ProcName)
I know this can be emulated by replacing prologue macro but having a builtin equate would be nice and it wouldn't break "release" code ML compatibility.
regards,
drizz
if it was a bit unclear i was thinking of c/c++ __func__ equivalent;
to be set inside proc -- endp block
IIRC I did introduce the OPTION RENAMEKEYWORD for such intentions.
This is an example how a @ProcName equate will "automatically" contain the name of the current proc:
[code]
.386
.model flat, stdcall
option renamekeyword:<proc>,_proc
option renamekeyword:<endp>,_endp
proc macro name:label, args:vararg
@ProcName equ <name>
name _proc args
endm
endp macro name:label
name _endp
@ProcName equ <>
endm
.code
firstproc proc
% echo current proc is @ProcName
ret
firstproc endp
secondproc proc
% echo current proc is @ProcName
ret
secondproc endp
end
[/code]
Nice example for the new renamekeyword option!
But using custom prologue macro in this case would be cleaner since nested macros can cause problems.
this will fail:
main proc C <FORCEFRAME> uses esi edi ebx, argc:dword, argv:ptr dword
%echo current proc is @ProcName
ret
main endp
it's not a problem really, as i said i can work it out with prologue macro what i was hoping for was simplification with built in equate same as C99's __func__.