how to declare such a macro? basically we have only
a number of parameters (%0) - four in this case and
macro should push all the parameters in reverse order
as a dwords, so above call would expand to something
like this:
push dword [param3]
push dword [param2]
...
call my_proc
I need this because my routines requires 5 or more
parameters passed by stack and all of them pushed
in reverse order work, but the source is completly
unreadable; sometimes I have to comment all of them
in order to remember what I'm currently pushing
onto the stack... :|
Of course macro doesn't have to be called "call",
but I know it is possible to define macros using
names which are normally thought as "restricted".
--
Argasek/IPL
The ImPLosion. To my zbudowaliśmy jelcz.
http://www.argasek.z.pl/ arg...@ipl.z.pl
> like in topic: i'm looking for macro for NASM which would
> allow me to call procedure with parameters in TASM fashion,
> i.e.
> call my_proc,[param1],[param2],[param3]
...try this :
%imacro CALL 2-* ; accepts 'call','CaLL',cALL'...
%rotate -1 ; rotate left...rotates 'my_proc'
%rep %0 - 1 ; number of paras...
push %1 ; 1st time, 1 st parameter....
%rotate -1 ; next para..
%endrep
call %1 ; and now, the real call...
%endmacro
NASM decides on the number of parameters, if 'call' will be the function
or macro...
paramcount 2+ -> macro
paramcount 1 -> function
Use it like this:
my_text db 'Hello World',0
call my_proc, my_text, dword [my_var], eax, dword 0123h, my_text
good luck...
kisda
Peter Johnson
lo...@mcs.net
On 1 Oct 1999 21:06:09 GMT, "J. Argasiński" <arg...@ipl.z.pl> wrote:
>
>like in topic: i'm looking for macro for NASM which would
>allow me to call procedure with parameters in TASM fashion,
>i.e.
> call my_proc,[param1],[param2],[param3]
>
Peter Johnson źśźgŠó¤ĺłš <7t4u07$kp9$3...@autumn.news.rcn.net>...