The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: gwapo on February 15, 2006, 03:57:51 AM

Title: Output in params
Post by: gwapo on February 15, 2006, 03:57:51 AM
Hi,

How can we make a proc in MASM that will return an output into one of its parameters? Something like an "out" or "ref" keyword of C++?

BOOL MyProc
   ( int InputParam, ref int RefParam, out int OutParam )
{
   OutParam = 1001;
   RefParam = 2002;
   return TRUE;
}

How can we make something like the above C++ code in MASM? A procedure that will return either TRUE or FALSE to indicate success or failure, but the actual output is placed on to the parameters? and it has the ability to modify parameters.

Thanks in advance,

-chris
Title: Re: Output in params
Post by: zooba on February 15, 2006, 05:16:50 AM
You need to pass an address/pointer rather than a value. I believe 'REF' and 'OUT' are ways of doing this transparently.
Title: Re: Output in params
Post by: gwapo on February 15, 2006, 06:59:05 AM
Thanks zooba :)

-chris