SDCC allows the use of in-line assembler with a few restrictions regarding labels. All labels defined within inline assembler code have to be of the form nnnnn$ where nnnnn is a number less than 100 (which implies a limit of utmost 100 inline assembler labels per function).3.6
_asmInline assembler code cannot reference any C-labels, however it can reference labels defined by the inline assembler, e.g.:
mov b,#10
00001$:
djnz b,00001$
_endasm ;
foo() {In other words inline assembly code can access labels defined in inline assembly within the scope of the function. The same goes the other way, i.e. labels defines in inline assembly can not be accessed by C statements.
/* some c code */
_asm
; some assembler code
ljmp 0003$
_endasm;
/* some more c code */
clabel: /* inline assembler cannot reference this label */ 3.7
_asm
0003$: ;label (can be referenced by inline assembler only)
_endasm ;
/* some more c code */
}