Pure Inline Assembly Functions

One can define a whole function to be written in inline assembly using the syntax

  __asm <return_type> function_name(<parameters_list>)

  {

  local vars list>

  <Assembly Instruction>

  ...

  }
  

In pure inline assembly functions there can be also declared and used local variables.

The declaration part is written as in C, while the usage of local variables is done in assembly instructions.

The compiler default behavior is to generate prologue and epilogue code for pure inline assembly functions, especially for handling parameters, return value and local variables.

This behavior can be altered using specific pragmas to avoid prologue, epilogue generation:

  #pragma NO_ENTRY  
  #pragma NO_EXIT  
  #pragma NO_RETURN  

If the function uses these pragmas, the user should be aware that the local variables declaration will be impacted (usually when using these pragmas, the stack management is the user full responsability). The pure inline assembly functions use the usual calling convention, unless the user is defining own parameter handling.