Hi,
this is one of means to HLL procedure parameters passing.
Example:
...
.buf rb str_size
...
stdcall ,addr[.buf],str
...
Alteration in macro "stdcall":
macro stdcall procname,
{common
addr equ
ADDR equ
if ~ arg eq
reverse
if _#arg in <_addr arg,_ADDR arg>
lea edx,arg
push edx
else
push arg
end if
common
end if
call procname}
Posted on 2002-11-20 06:28:44 by tserk
:alright: That's really very nice! This is the first time I see someone's using the fasm's macro power better than me :grin:
You can also put "addr equ" and "ADDR equ" outside the macro, just after (or before) its definition, so it won't be repeated each time you use this macro (but will become vulnerable for the user redefinition of those constants).
Posted on 2002-11-20 07:00:31 by Tomasz Grysztar
To Privalov,
making an use case...
Help me, please...
Posted on 2002-11-20 10:00:13 by tserk
Well... right, the parser was still a bit too strict. I've put a small corrections in several places and now it's OK (please download fasm141.zip once again to have the latest version, with such small and not-so-important fixes I often change only the release date), please try replacing appropriate lines in your macro with the following:


else if var1 in <REGISTERS> & ~ var2 in <REGISTERS>
if var2 eq +var2
if ~ var2
test var1,var1
else
cmp var1,var2
end if
end if
else
cmp var1,var2
end if
Posted on 2002-11-20 10:51:41 by Tomasz Grysztar
Result is ok.
times 8 db 'Thank you!'
Posted on 2002-11-21 01:50:35 by tserk