Using instr to parse macro paramaters 
Author Message
 Using instr to parse macro paramaters

Could someone give me the syntax for using instr?  I'm trying to pass some

the end of the arguments.  I keep getting invalid character errors when
trying the following...


   code
  else
    more code

Also, does anyone know if you can pass multiple paramaters to a macro even
though the macro is defined to only accept one?  I've done this with a MIPS
assembler, but when trying it with MASM, I'm getting an error saying too
many params.  I want to set up some macros that call functions but don't
want to have to write a seperate macro depending on the number of arguments.



Sun, 10 Mar 2002 03:00:00 GMT  
 Using instr to parse macro paramaters

Quote:

> Could someone give me the syntax for using instr?  I'm trying to pass some

> the end of the arguments.  I keep getting invalid character errors when
> trying the following...


>    code
>   else
>     more code

        There is a macro and a directive of the same basic name.
        Their syntax is:


        name INSTR [position,] textitem1, textitem2


        <string2> inside <string1> and returns the position of the
        first character of the match.  The search begins at <position>,

        macros or expressions unless you use the expression operator
        (%).


        <string1> is not found.


        assigns the result to <name>.

Quote:
> Also, does anyone know if you can pass multiple paramaters to a macro even
> though the macro is defined to only accept one?  I've done this with a MIPS
> assembler, but when trying it with MASM, I'm getting an error saying too
> many params.  I want to set up some macros that call functions but don't
> want to have to write a seperate macro depending on the number of arguments.

        Why do you not use the VARARG option?  This will allow you
        to pass as many or as few arguments as desired.

Hope that this is of some help.

Ray



Sun, 10 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. using # paramater with wrl links doesn't work with IE5

2. Using INSTR in MASM

3. Macro parsing?

4. Macro Parsing...

5. Dylan program structure and macro parsing

6. Dylan program structure and macro parsing

7. syntax, lexing and parsing, macros

8. Dragon Macros (was: RE: Help Rewriting/Refactoring/Rethinking Parsing Algorythm)

9. Pragmatic parsing macros

10. Pragmatic parsing macros (aka. META)

11. A macro involving two sub-macros - where the 2nd macro needs results from the first

12. Next instr of the week - CS please

 

 
Powered by phpBB® Forum Software