This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

"Real" Inline ASM in C

Hi!

To speed up a routine in a C-project, I implemented a function which is called several times in assembler. At the moment it looks like the following:

void myop(unsigned char a, unsigned char b) {
  #pragma asm
  .....
  #pragma endasm
}

myop(1, 2);
myop(3, 4);
....

If I take a look at the debuger, the compiler always does a LJMP to execute the function. The assembler code in myop() is ~35 lines of code.

Is it possible to define myop as a macro that it gets completely inlined without doing LJMPs?

I am search for something like:

#define myop(a, b) (#pragma asm; .....; #pragma endasm)

Or maybe I can just include in from some external file?

Thanks for help in advance!
Cheers Markus