#pragma code_seg( [ [ { push | pop}, ] [ identifier, ] ] [ "segment-name" [, "segment-class" ] )
Specifies the segment where functions are stored in the .obj file. OBJ files can be viewed with the dumpbin application. The default segment in the .obj file for functions is .text.
code_seg with no parameters resets the segment to .text.
identifier enables multiple records to be popped with a single pop command.
void func1() { // stored in .text } #pragma code_seg(".my_data1") void func2() { // stored in my_data1 } #pragma code_seg(push, r1, ".my_data2") void func3() { // stored in my_data2 } #pragma code_seg(pop, r1) // stored in my_data1 void func4() { } void main() { }
See /SECTION for a list of names you should not use when creating a section.
You can also specify sections for initialized data (data_seg), uninitialized data (bss_seg), and const variables (const_seg).