Description
The #pragma code_seg directive marks the current code segment in effect.
Syntax
#pragma code_seg ([code_segment | "code_segment"])
Functions defined after a #pragma code_seg are placed in code_segment specified by the most recent #pragma code_seg. More specifically, the function is placed in the code_segment that is in effect at the opening brace of the function definition. Enclosing code_segment and class in double quotation marks is optional and is provided for compatibility with Microsoft Visual C++.
The empty parentheses form of #pragma code_seg changes the current segment to the default code_segment. The default code segment is the segment active at the beginning of of the translation unit before any source code processing has begun.
For example,
#pragma code_seg ("first_seg") int first(int a) { return a; } #pragma code_seg()