AutosarC++18_10-M7.4.3

Assembly language shall be encapsulated and isolated

Rationale

Ensuring that assembly language code is encapsulated and isolated aids portability.

Where assembly language instructions are needed, they shall be encapsulated and isolated in either assembler functions or C++ functions.

Example
void Delay ( void ) 
{
asm ( "NOP" ); // Compliant
}
void fn ( void )
{
DoSomething ( );
Delay ( ); // Assembler is encapsulated
DoSomething ( );
asm ( "NOP" ); // Non-compliant
DoSomething ( );
}

Note

For legal reasons, this rule’s description is not part of the public documentation.