The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ctt on November 23, 2005, 09:43:22 AM

Title: Quick question about return values.
Post by: ctt on November 23, 2005, 09:43:22 AM
I have codesnippets with "return Var" in them... my question, how do i use it? return aint something that masm32 knows by default as far as I know, or is the snippets for some other assembler?  ::)

Exampel

...
ADDR lpData,ADDR dwSize
invoke RegCloseKey,phkResult
return lpData
...


Thanks!
Title: Re: Quick question about return values.
Post by: Tedd on November 23, 2005, 12:52:58 PM
Most likely it's a macro which does this:

mov eax,lpData
ret


(eax is conventionally used for returning values)
Title: Re: Quick question about return values.
Post by: ctt on November 23, 2005, 01:24:28 PM
Sweet, i was fishing for something like that but i wasn't sure.
Thanks  :U
Title: Re: Quick question about return values.
Post by: raymond on November 23, 2005, 05:14:55 PM
It is one of the many macros listed in the MACROS.ASM file provided with the MASM32 package.

      return MACRO arg
        mov eax, arg
        ret
      ENDM


Raymond