Next pragma STRING_SEG
#pragma STRING_SEG (<Modif><Name>|DEFAULT)
STRING_SECTION
<Modif>: Some of the following strings may be used:
__DIRECT_SEG (compatibility alias: DIRECT)
__NEAR_SEG (compatibility alias: NEAR)
__CODE_SEG (compatibility alias: CODE)
__FAR_SEG (compatibility alias: FAR)
__LINEAR_SEG
The __SHORT_SEG modifier specifies a segment that is accessed using 8-bit addresses. The definitions of these segment modifiers are backend-dependent. Refer to HC(S)08 Backend to find the supported modifiers and their definitions.
<Name>: The name of the segment. This name must be used in the link parameter file on the left side of the assignment in the PLACEMENT part. Refer to the linker manual for details.
DEFAULT
This pragma allocates strings into a linker segment called STRINGS. String segments may have modifiers. The modifiers instruct the Compiler to access the strings in a special way when necessary.
The linker treats segments defined with the pragma STRING_SEG like constant segments defined with #pragma CONST_SEG and allocates the segments in ROM areas.
The pragma STRING_SEG sets the current string segment and places all new strings into the current segment.
The synonym STRING_SECTION means exactly the same as STRING_SEG.
the following shows the STRING_SEG pragma allocating strings into a segment with the name STRING_MEMORY.
#pragma STRING_SEG STRING_MEMORY char* p="String1"; void f(char*); void main(void) { f("String2"); } #pragma STRING_SEG DEFAULT
Linker section of the Build Tool Utilities manual
#pragma CODE_SEG: Code Segment Definition