The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: xroot on January 30, 2009, 04:04:15 PM

Title: How to use proc vars with macro's
Post by: xroot on January 30, 2009, 04:04:15 PM

A_function proc var1:dword,var2:dword,var3:dword etc.......
   
some_macro var1,var2,var3, etc........

A_fucntion endp

How do you convert the var's so the macro will work?

Title: Re: How to use proc vars with macro's
Post by: Jimg on January 30, 2009, 04:52:01 PM
That not a simple question.  vars in macros are basically character strings.  You either have to know exactly what you are getting, or you have to test their opattr and type to know how to handle them.
Title: Re: How to use proc vars with macro's
Post by: BogdanOntanu on January 30, 2009, 08:13:08 PM
You do not have to do anything special.

For example the following code does work as expected:

IN_PROC  macro arg1,arg2
    mov arg1,0
    mov arg2,0
endm

my_func proc var1 :dword, var2:dword

    IN_PROC var1,var2
   
    mov ecx,1
    ret
my_func endp