The MASM Forum

General => The Campus => Topic started by: Zen on June 24, 2016, 04:33:38 AM

Title: rv Macro
Post by: Zen on June 24, 2016, 04:33:38 AM
I've run into this macro in source code many times,...and, I've always assumed that it means to execute the enclosed function and move the return value into eax (or something like that). But, where is this macro defined ??? Or, is it a built in function ??? I can't find it in a cursory search of MASM include files or macros.asm. Searching here at the MASM Forum, I found this in a post by JOCHEN: ; rv ("return value") is a Masm32 macro. I even Googled it, and got this: Using rv macro (http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=18760.0)
Title: Re: rv Macro
Post by: mabdelouahab on June 24, 2016, 04:37:59 AM
\masm32\macros\macros\macros.inc
Title: Re: rv Macro
Post by: Zen on June 24, 2016, 04:38:41 AM
First place I looked (well, I searched for _rv).
...But, yes, the rv macro is in macros.asm. Is this the same as the _rv macro (I assume that it is) ???
Title: Re: rv Macro
Post by: mabdelouahab on June 24, 2016, 04:41:55 AM
\masm32\include\Masm32Ref.INC
Title: Re: rv Macro
Post by: Zen on June 24, 2016, 04:43:20 AM
...OHhhh,...
Thanks, MABDELOUAHAB, I wondered,...:bgrin:
Title: Re: rv Macro
Post by: mabdelouahab on June 24, 2016, 04:49:38 AM
you can use Saleen ScanFs (http://www.saleensoftware.com/scanfs)
Title: Re: rv Macro
Post by: jj2007 on June 24, 2016, 05:53:41 AM
There are quite a number of related macros in macros.asm, for example:
rv rv MACRO FuncName:REQ,args:VARARG
rvc rvc MACRO FuncName:REQ,args:VARARG
rvx rvx MACRO FncName:req,args:VARARG
rvcx rvcx MACRO FncName:req,args:VARARG


;/********************************************************************/
;/*                     rvcx - macro function                        */
;/* This macro behave like the rvx-macros, except, that it adds      */
;/* support for escape sequences:                                    */
;/*     \\  ->  "\"                                                  */
;/*     \t  ->  tab                                                  */
;/*     \n  ->  new line (13,10)                                     */
;/*     \x  ->  "!"                                                  */
;/*     \a  ->  "("                                                  */
;/*     \b  ->  ")"                                                  */
;/*     \l  ->  "<"                                                  */
;/*     \r  ->  ">"                                                  */
;/*     \p  ->  "%"                                                  */
;/*     \A  ->  "&"                                                  */
;/*     \q  ->  double quote '"'                                     */
;/*     \0  ->  zero                                                 */
;/* Example:                                                         */
;/*     mov edi,rv(myFunction,L"my string\x\n",&wsz[0],...)          */
;/*                                                     qWord, 2011  */
;/********************************************************************/

Title: Re: rv Macro
Post by: HSE on June 24, 2016, 05:55:13 AM
 mabdelouahab: That it's a nice utility! A lot of blondes!!

I'm using JJ search utility, that only show sad code files  :biggrin:
Title: Re: rv Macro
Post by: Zen on June 24, 2016, 06:43:14 AM
Thanks, MABDELOUAHAB and JOCHEN,
This is stuff that I should have learned long ago. :dazzled:
Also, this is one of the things that I find most annoying about using the MASM32 package and compiler,...searching for function definitions, so that you can include the correct INC file in your main MASM project file.
I was thinking last year of writing a plug-in for HUTCH's Quick Editor that would automate the process,...similar to what Intellisense (http://using%20intellisense) does for the Visual Studio integrated development environment. But, I'm too lazy. :bgrin:
Title: Re: rv Macro
Post by: jj2007 on June 24, 2016, 07:36:29 AM
Quote from: Zen on June 24, 2016, 06:43:14 AMsearching for function definitions, so that you can include the correct INC file in your main MASM project file.
I was thinking last year of writing a plug-in for HUTCH's Quick Editor that would automate the process

See FindOnDisk (http://masm32.com/board/index.php?topic=2935.msg30705#msg30705)
Title: Re: rv Macro
Post by: Zen on June 24, 2016, 08:32:41 AM
WHAT ??? You've already done what I've only dreamed of ???
:bgrin: ...Dang...you see,...this is why Italian people make my brain hemorrhage,...:bgrin:
Title: Re: rv Macro
Post by: jj2007 on June 24, 2016, 09:28:58 AM
Here is a polished version. In RichMasm, it's already included under "System& plugins". If you can convince qEditor to launch the exe and supply a commandline with the currently selected text, e.g. MessageBox PROTO, it will work.

FindOnDisk needs:

1. one or two args in the commandline: if two are supplied,
match means second follows first within n chars


2. FindOnDisk.ini in the same folder:

\Masm32\include\*.inc ; default path to start (edit if needed)
Select 'whatever', ... ; hint if no arg found in the commandline
PROTO ; proposal of text for second criterion, if none found
1 ; mode for 1st arg: 1=case-insensitive, 4=full word
1 ; mode for 2nd arg: 5=full word and case-insensitive
10 ; max distance, e.g. Message....PROTO needs 4 to match


For maxDist=0, the whole inc file will be searched for the second criterion - not always useful 8)
Title: Re: rv Macro
Post by: hutch-- on June 24, 2016, 11:01:51 AM
Hmmmm,

There are times when I wonder why I went blind and mad producing help files with full documentation when it appears that so many people don't read them.

FILE: High Level Macro Help
Category: Macro Categories
Topic: Code Calling Macros

You have 2 sets of code calling macros, the original ones I wrote and an extended set written by QWORD.
Both support reference and indirection operators.

MACRO code for all of them is in MACROS.INC.
Title: Re: rv Macro
Post by: HSE on June 24, 2016, 11:41:38 PM
Hi Hutch!

I think that help file it's not in current MASM32 package. I don't find it.
Title: Re: rv Macro
Post by: jj2007 on June 25, 2016, 01:46:20 AM
Should be \Masm32\help\hlhelp.chm
Title: Re: rv Macro
Post by: Zen on June 25, 2016, 03:56:11 AM
HUTCH,
Thanks for the suggestions. I've read and re-read those help files many times,...but, my mind is gone (advanced dementia),...so, I forget almost everything I read,...:dazzled:
Title: Re: rv Macro
Post by: HSE on June 25, 2016, 06:53:26 AM
hlhelp.chm is in place. I don't know how is posible to skip the file several times, but it's posible. Thanks JJ  :t         
Title: Re: rv Macro
Post by: hutch-- on June 25, 2016, 11:21:54 AM
Zen,

I have been claiming "senile decay" since I was 50 (some time ago now) but its switchable, I turn the switch ON when I need to say "I don't remember ever making a mistake" and switch it OFF when its no longer needed.