The following listing shows a method of directly allocating variables in a named segment, rather than using a #pragma.
#pragma DATA_SEG dseg int i@"dseg";
With some pragmas in a common header file and with another macro definition, you can allocate variables depending on the macro.
Declaration = <TypeSpec><Declarator>[@"<Section>"][=<Initializer>];
Variables declared and defined with the @"section" syntax behave exactly like variables declared after their respective pragmas.