Link to home
Start Free TrialLog in
Avatar of icd
icd

asked on

_asm inside a #define

In MSVC 4.1 I can write the following code

      __asm {
            jb 0x01
            jb 0xf9
      }

If however I put it into a macro:-

#define OB3 __asm { \
      jb 01 \
      jb 0xf9 \
}

and then use the macro in my code:-

OB3;

I get an error on each use of the macro.

warning E4405 warning 'jb' is a reserved word
error C2400 inline assembler syntax error in 'first operator'; found 'constant'.

This seems to happen with any assembler I create. How can I generate assembler within a macro?
Avatar of Bonev
Bonev

What about the semicolon after the macro?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of icd

ASKER

Thanks, that did it.