News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

rv Macro

Started by Zen, June 24, 2016, 04:33:38 AM

Previous topic - Next topic

Zen

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

mabdelouahab

\masm32\macros\macros\macros.inc

Zen

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) ???

mabdelouahab

\masm32\include\Masm32Ref.INC

Zen

...OHhhh,...
Thanks, MABDELOUAHAB, I wondered,...:bgrin:

mabdelouahab


jj2007

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  */
;/********************************************************************/


HSE

 mabdelouahab: That it's a nice utility! A lot of blondes!!

I'm using JJ search utility, that only show sad code files  :biggrin:
Equations in Assembly: SmplMath

Zen

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 does for the Visual Studio integrated development environment. But, I'm too lazy. :bgrin:

jj2007

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

Zen

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:

jj2007

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)

hutch--

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.

HSE

Hi Hutch!

I think that help file it's not in current MASM32 package. I don't find it.
Equations in Assembly: SmplMath

jj2007

Should be \Masm32\help\hlhelp.chm