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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>C++</strong> dynamic initializationINTERRUPT VECTORSThe interrupt vector table contains pointers to interrupt routines, including the resetroutine. The table is placed in the segment INTVEC. For the <strong>MSP430</strong> microcontroller, itshould end at address 0xFFFF. For a device with 16 interrupt vectors, this means that thesegment should start at the address 0xFFE0, for example:-Z(CONST)INTVEC=FFE0-FFFFThe system startup code places the reset vector in the RESET segment; the INTVECsegment cannot be used by the system startup code because the size of the interruptvector table varies between different devices. In the linker command file it can look likethis:-Z(CONST)RESET=FFFE-FFFFAn application that does not use the standard startup code can either use the RESETsegment, or define an interrupt function on the reset vector, in which case the INTVECsegment is used.<strong>C++</strong> dynamic initializationIn <strong>C++</strong>, all global objects will be created before the main function is called. The creationof objects can involve the execution of a constructor.The DIFUNCT segment contains a vector of addresses that point to initialization code.All entries in the vector will be called when the system is initialized.For example:-Z(CONST)DIFUNCT=1100-FFFEFor additional information, see DIFUNCT, page 248.Verifying the linked result of code and data placementThe linker has several features that help you to manage code and data placement, forexample, messages at link time and the linker map file.SEGMENT TOO LONG ERRORS AND RANGE ERRORSAll code or data that is placed in relocatable segments will have its absolute addressesresolved at link time. It is also at link time it is known whether all segments will fit inthe reserved memory ranges. If the contents of a segment do not fit in the address rangedefined in the linker command file, XLINK will issue a segment too long error.42<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

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

Saved successfully!

Ooh no, something went wrong!