Does it depend on the built-in controller that I use?
Yes. Embedded assembly is not part of the C standard (yet), it varies from compiler to compiler, and sometimes even between different target architectures of the same compiler. For more information, see the Inward Part of the ANSI C ASM Standard .
For example, for the C51 Keil compiler, syntax for inline assembly
... #pragma asm NOP #pragma endasm ...
and for ARM syntax is similar to
... __asm { NOP } ...
You will need to check the manual for the actual compiler that you are using.
For some of the most common opcode, some compilers provide so-called internal functions โ they can be called as a C function, but essentially you can insert assembler code like _nop_ () .
Andreas Fester
source share