PRM File

If you are using the CodeWarrior IDE to manage your project, a pre-configured PRM file for a particular derivative is already set up, as the following listing displays.

Listing: Linker PRM file for mc9s08gt60 derivative - Project.prm
/* This is a linker parameter file for the mc9s08gt60 */
NAMES END /* CodeWarrior will pass all the needed files to the linker 
by command line. But here you may add your own files too. */

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in 
PLACEMENT below. */

    Z_RAM                    =  READ_WRITE   0x0080 TO 0x00FF;

    RAM                      =  READ_WRITE   0x0100 TO 0x107F;

    ROM                      =  READ_ONLY    0x182C TO 0xFFAF;

    ROM1                     =  READ_ONLY    0x1080 TO 0x17FF;

    ROM2                     =  READ_ONLY    0xFFC0 TO 0xFFCB;

 /* INTVECTS                 =  READ_ONLY    0xFFCC TO 0xFFFF; Reserved 
for Interrupt Vectors */

END

PLACEMENT /* Here all predefined and user segments are placed into the 
SEGMENTS defined above. */

    DEFAULT_RAM,                        /* non-zero page variables */

                                        INTO  RAM;

    _PRESTART,                          /* startup code */

    STARTUP,                            /* startup data structures */

    ROM_VAR,                            /* constant variables */

    STRINGS,                            /* string literals */

    VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */

    DEFAULT_ROM,

    COPY                                /* copy down information: how 
to initialize variables */

                                        INTO  ROM; /* ,ROM1,ROM2: To use 
"ROM1,ROM2" as well, pass the option -OnB=b to the compiler */

    _DATA_ZEROPAGE,                     /* zero page variables */

    MY_ZEROPAGE                         INTO  Z_RAM;

END

STACKSIZE 0x50

VECTOR 0 _Startup /* Reset vector: this is the default entry point for 
an application. */

The following listing is an example Linker PRM file for the RS08 derivative.

Listing: Linker PRM file for RS08 derivative - Project.prm
NAMES END /* CodeWarrior will pass all the needed files to the linker 
by command line. But here you may add your own files too. */
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in 
PLACEMENT below. */

    TINY_RAM                 =  READ_WRITE   0x0005 TO 0x000D;

    RAM                      =  READ_WRITE   0x0020 TO 0x004F;

    RESERVED_RAM             =  NO_INIT      0x0000 TO 0x0004;

    ROM                      =  READ_ONLY    0x3C00 TO 0x3FF7;

END

PLACEMENT /* Here all predefined and user segments are placed into the 
SEGMENTS defined above. */

    RESERVED                 INTO RESERVED_RAM;

    TINY_RAM_VARS            INTO TINY_RAM;

    DIRECT_RAM_VARS          INTO RAM, TINY_RAM;

    DEFAULT_RAM              INTO RAM, TINY_RAM;

    DEFAULT_ROM              INTO ROM;

END

STACKSIZE 0x00 /* no stack for RS08 */

VECTOR 0 _Startup /* Reset vector: this is the default entry point for 
an application. */

The Linker PRM file allocates memory for the stack and the sections named in the assembly source code files. If the sections in the source code are not specifically referenced in the PLACEMENT section, then these sections are included in DEFAULT_ROM or DEFAULT_RAM.

The STACKSIZE entry is used to set the stack size. The size of the stack for this project is 80 bytes. Some entries in the Linker PRM file may be commented-out by the IDE, as are the three last items in the Project.prm file in the listing, Linker PRM file for mc9s08gt60 derivative - Project.prm.