I have these 2 macros:
;----------------------------
macro call proc, [arg]
{
common
__ARGC= 0
if ~ arg eq
forward
__ARGC= __ARGC+1
reverse
if arg in <eax,ebx,ecx,edx,esi,edi,ebp,esp>
push arg
__ARGC= __ARGC+1
else
push arg
end if
common
end if
call proc
if ~ arg eq
add sp,2*__ARGC
end if
}
;----------------------------
;----------------------------
macro calld proc, [arg]
{
common
__ARGC= 0
if ~ arg eq
forward
__ARGC= __ARGC+1
reverse
push arg
common
end if
call proc
if ~ arg eq
add sp,4*__ARGC
end if
}
;----------------------------
If I use the above code the 2nd macro will always mov 0 into sp! Why? If I use another name for __ARGC it is working.