asm in c macro. how 
Author Message
 asm in c macro. how

I cant get a macro filled with inline assembly to work. I can get just the
macro to compile, but if I try to use it, it no longer compiles. Is it
possible? an example would be great!!!

Thank You
dave



Sat, 08 Jun 2002 03:00:00 GMT  
 asm in c macro. how

comp.lang.asm.x86:

Quote:
> I cant get a macro filled with inline assembly to work. I can get just the
> macro to compile, but if I try to use it, it no longer compiles. Is it
> possible? an example would be great!!!

> Thank You
> dave

Not enough information in your post.  Exactly what brand and version
of compiler, and post the code.

Jack Klein
--
Home: http://jackklein.home.att.net



Mon, 10 Jun 2002 03:00:00 GMT  
 asm in c macro. how

Quote:

> I cant get a macro filled with inline assembly to work. I can get just the
> macro to compile, but if I try to use it, it no longer compiles. Is it
> possible? an example would be great!!!

How did you write the macro and how did you use it? Perhaps the macro
invocation is expanding the wrong way. For example:

#define TEST(x) __asm mov eax,x __asm dec eax
....
if (condition)
        TEST(x)
else
        ...

would expand to:

if (condition)
        __asm mov eax,x
__asm dec eax
else    // error: no matching if

You might try putting the statements (remember, __asm acts as a
statement delimiter) inside braces, like this:

#define TEST(x) { __asm mov eax,x __asm dec,eax }

This (with the above example) would expand to:

if (condition)
{       __asm mov eax,x __asm dec eax }
else    // ok, matching if present

HTH,
        AriL
--
A multiverse is figments of its own imaginations.
Homepaged at http://www.angelfire.com/or/lukumies



Mon, 10 Jun 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

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

2. C and asm macro

3. asm macro

4. FS: IBM Macro ASM V 2.0

5. Square Root in ASM (I'd also like a print literal Macro)

6. ASM Macros ?

7. FS: IBM Macro ASM V 2.0

8. challenge for MACRO experts & ASM gurus

9. Macro Preprocessor (was: C -> ASM compression problem)

10. ASM Macro

11. macro -vs- macro/codeblock

12. Help with macros writing macros in Bigloo

 

 
Powered by phpBB® Forum Software