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 dataNote: Copy initialization segments—BASENAME_I and BASENAME_ID—must beplaced using -Z.Data segmentsThis section contains descriptions of the segments used for storing the different types ofdata: static, stack, heap, and located.To get a clear understanding about how the data segments work, you must be familiarwith the different memory types and the different data models available in the <strong>MSP430</strong><strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>. If you need to refresh these details, see the chapter Data storage.STATIC MEMORY SEGMENTSStatic memory is memory that contains variables that are global or declared static, asdescribed in the chapter Data storage. Declared static variables can be divided into thefollowing categories:● Variables that are initialized to a non-zero value● Variables that are initialized to zero● Variables that are located by use of the @ operator or the #pragma locationdirective● Variables that are declared as const and therefore can be stored in ROM● Variables defined with the __no_init keyword, meaning that they should not beinitialized at all.For the static memory segments it is important to be familiar with:● The segment naming● How the memory types correspond to segment groups and the segments that are partof the segment groups● Restrictions for segments holding initialized data●The placement and size limitation of the segments of each group of static memorysegments.Segment namingThe names of the segments consist of two parts—the segment group name and asuffix—for instance, DATA16_Z. There is a segment group for each memory type, whereeach segment in the group holds different categories of declared data. The names of thesegment groups are derived from the memory type and the corresponding keyword, forPart 1. Using the compiler35

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

Saved successfully!

Ooh no, something went wrong!