Am 14.07.22 um 14:46 schrieb Maarten Brock:
Hi Philipp,
Philipp Klaus Krause schreef op 2022-07-14 12:58:
SDCC currently supports two forms of inline assembler:
1:
__asm
asm code here
__endasm;
and
2:
__asm("asm code here");
Does (or will) this second form also support multiple asm instructions?
AFAIK it doesn't.
void f(void)
{
__asm__("nop\nnop");
}
and
void f(void)
{
__asm__("nop\n"
"nop");
}
both work.
Form 1 requires some ugly hacks to avoid conflicts in the preprocessor.
I wonder if we could drop those, and maybe even change the keyword in
form 2 to __asm__.
Does anyone rely on form 1 and would not want support for it dropped?
Any opinions on the possible rename of form 2?
I have no objections against renaming with a deprecation period, though
I do wonder why.
Looks like I made a mistake there. Actually, form 2 already uses
__asm__, and doesn't even work with __asm now. I think I was looking at
some outdated documentation.
Since people like form 1, I'd now think we should keep it, but drop
#pragma sdcc_hash. That looks like a better way forward and also solves
the issues.
Philipp
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user