Allocating a Segment in Specific Memory

In the PRM file, you can define where you want to allocate each segment you have defined in your source code. In order to place a segment in a specific memory area, just add the segment name in the PLACEMENT block of your PRM file. Be careful, as the linker is case-sensitive. Pay special attention to the upper and lower cases in your segment name.

Listing: Allocating a Segment in Specific Memory


LINK  test.abs
NAMES test.o ... END

SECTIONS 

  INTERRUPT_ROM = READ_ONLY   0x4000 TO  0x5FFF;

  MY_RAM        = READ_WRITE  ... 

PLACEMENT

  Int_Function               INTO INTERRUPT_ROM;

  DEFAULT_RAM                INTO MY_RAM;

  ...

END