Crossware

Table of Contents        Previous topic       Next topic       

C/C++ COMPILER->Pragmas->#pragma code_seg



#pragma code_seg( ["section-name"] )

The code_seg pragma specifies the code section where functions are to be placed. Section name can be any valid string contant.  To avoid conflict with the default sections used by the compiler, avoid using names beginning with a double underscore.

Using #pragma code_seg without a section-name string resets allocation to the default section.

Example:

#pragma code_seg(MYCODE)

function1()
{

}

#pragma code_seg()

function2()
{

}

The code generated for function1 will be placed in code section MYCODE.  The code generated for function2 will be placed in the compilers default code section.