27-11-2019, 10:03 AM
Directive 4.3 states that the assembly language instruction shall be "encapsulated and isolated". This guideline is a directive rather than a rule, which means that the phrase "isolated" should not be taken as fully defined and may be interpreted in different ways by different projects.
The intention is that there should be minimal C code within the enclosing macro or function. In particular, the intention is that there should be no C language statements which have effects in the abstract machine. For example:
* expression statements
* selection statements
* iteration statements
The MISRA-C working group would consider that a function that contains only declarations and a return statement in addition to the assembler code instructions is acceptable.
The intention is that there should be minimal C code within the enclosing macro or function. In particular, the intention is that there should be no C language statements which have effects in the abstract machine. For example:
* expression statements
* selection statements
* iteration statements
The MISRA-C working group would consider that a function that contains only declarations and a return statement in addition to the assembler code instructions is acceptable.
Posted by and on behalf of the MISRA C Working Group