I'm using SDCC's inline assembly syntax for my project:
void delay_ms(uint16_t ms) {
_ms = ms;
__asm
ldw y, __ms ; Load ms counter into y register: 2 cycles
0000$:
ldw x, _CYCLES_PER_MS ; Load tick counter into x register: 2 cycles
0001$:
decw x ; Decrease tick counter: 1 cycle
jrne 0001$ ; Check if 1ms passed: 2 cycles (except for x == 0 where it's just 1 cycle)
decw y ; Decrease ms counter: 1 cycle
jrne 0000$ ; Check if provided time has passed: 2 cycles (except for y == 0 where it's just 1 cycle)
__endasm;
}
Unfortunately VScode's language syntax highlighting still interprets the inline assembly code as C code which is quite annoying:
Is it possible to completely disable syntax highlighting for a range of lines in your file?