There are two forms of inline assembly, one is
asm{
//...
}
the other
asm(
"..."//work in my clang compiler
);
and __asm and so on, so what is the difference? definitely not just about curly braces and brackets, i hope
There are two forms of inline assembly, one is
asm{
//...
}
the other
asm(
"..."//work in my clang compiler
);
and __asm and so on, so what is the difference? definitely not just about curly braces and brackets, i hope
The C language does not support inline assembler, so either form is non-standard. Every compiler tends to do this differently and therefore the syntax will vary.
Some compilers use double underscore __
to let through all non-standard keywords even when compiling in C standard mode.
Unlike C, C++ does support it through standardization, in the form of asm("instruction");
.
Annex J of the C standard is informative and states that if asm
is supported (and it doesn't have to be), then it ought to be of the form
asm ( character-string-literal );
In other words, the notation using the braces is arguably less conventional than the one using the parentheses.
(The requirements in C++ are stronger.)