SDCC supports two formats for inline assembler code definition:
Most of inline assembler code examples in this manual use the old inline assembler code format, but the new format could be used equivalently.
Example:
__asmNote: As of SDCC 4.2.9, assembler comments occurring in this type of inline assembler block are affected by macro expansion.
; This is a comment
label:
nop
__endasm;
The __asm__ inline assembler code format was introduced in SDCC version 3.2.0. Its main advantage is that it is compatible with all standard compliant C preprocessors.
Example:
__asm__ (”; This is a comment\nlabel:\n\tnop”);Or for better readability:
__asm__ (
”; This is a comment\n”
”label:\n”
” nop”
);