Function
#pragma NO_ENTRY
None
None
None
This pragma suppresses the generation of entry code and is useful for inline assembler functions. The entry code prepares subsequent C code to run properly. It usually consists of pushing register arguments on the stack (if necessary), and allocating the stack space used for local variables and temporaries and storing callee saved registers according to the calling convention.
The main purpose of this pragma is for functions which contain only High-Level Inline (HLI) assembler code to suppress the compiler generated entry code.
One use of this pragma is in the startup function _Startup. At the start of this function the stack pointer is not yet defined. It has to be loaded by custom HLI code first.
This pragma is safe in functions with only HLI code. In functions that contain C code, using this pragma is a very advanced topic. Usually this pragma is used together with the pragma NO_FRAME.
The code generated in a function with #pragma NO_ENTRY may be unreliable. It is assumed that the user ensures correct memory use.
The following listing shows how to use the NO_ENTRY pragma (along with others) to avoid any generated code by the compiler. All code is written in inline assembler.
#pragma NO_ENTRY #pragma NO_EXIT #pragma NO_FRAME #pragma NO_RETURN void Func0(void) { __asm {/* No code should be written by the compiler.*/ ... } }