11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Placing code and dataIf you create your own segments, these must also be defined in the linker command fileusing the -Z or -P segment control directives.Code segmentsThis section contains descriptions of the segments used for storing code, and theinterrupt vector table. For a complete list of all segments, see Summary of segments,page 241.STARTUP CODEThe segment CSTART contains code used during system setup (cstartup). The systemsetup code should be placed at the location where the chip starts executing code after areset. For the <strong>MSP430</strong> microcontroller, this is at the reset vector address. In addition, thesegments must be placed into one continuous memory space, which means the -Psegment directive cannot be used.In the default linker command file, the following line will place the CSTART segment atthe address 0x1100:-Z(CODE)CSTART=1100-FFBFNORMAL CODECode for normal functions and interrupt functions is placed in the CODE segment. Again,this is a simple operation in the linker command file:/* For <strong>MSP430</strong> devices */-Z(CODE)CODE=1100-FFDF/* For <strong>MSP430</strong>X devices */-Z(CODE)CODE=1100-FFBF,10000-FFFFFINTERRUPT FUNCTIONS FOR <strong>MSP430</strong>XWhen you compile for the <strong>MSP430</strong>X architecture, the interrupt functions are placed inthe ISR_CODE segment. Again, this is a simple operation in the linker command file:-Z(CODE)ISR_CODE=1100-FFDFPart 1. Using the compiler41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!