AutosarC++17_03-M7.4.2¶
Assembler instructions shall only be introduced using the asm declaration
Required inputs: IR
| Level | required |
|---|---|
| Target | implementation |
| Enforcement | automated |
Rationale
The asm declaration is available to all C++ implementations, allowing a consistent mechanism to be used.
However, the parameters to asm are still implementation-defined.
Example
void Delay_a ( void )
{
asm ( "NOP" ); // Compliant
}
void Delay_b ( void )
{
#pragma asm
"NOP" // Non-compliant
#pragma endasm
}
Note
For legal reasons, this rule’s description is not part of the public documentation.