We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I'm having trouble using #pragma ASM/ENDASM inside a #define statement. This is what I want to do inside the #define:
- push ACC (assembly) - push IE (assembly) - EA = 0 (C)
This is the code I'm *trying* to use:
#define portENTER_CRITICAL() \ { \ #pragma ASM \ push ACC \ push IE \ #pragma ENDASM \ EA = 0; \ }
But I always get an error, no matter what I change... also, it seems that #pragma ASM/ENDASM can't be used inside header files (who knows why...), is there any workaround for that, without repeating the same #defines inside all .c files that uses it?
Best regards, Carlos.
PS: any one answering this thread, nevermind the "that's a bad practice! use separate asm and c source files! blah blah!..." comments... I really need this, so don't bother with those kind of comments...