
CAVR-4
vi
AVR® IAR C/C++ Compiler
Reference Guide
Data storage ...................................................................................................... 15
Introduction ..............................................................................................15
Storing data ........................................................................................15
Extended keywords for data ...............................................................16
Memory models ......................................................................................17
Specifying a memory model ..............................................................17
Memory types and memory attributes .........................................18
Using data memory attributes ............................................................19
Pointers and memory types ................................................................20
Structures and memory types ............................................................21
More examples ...................................................................................21
C++ and memory types ......................................................................22
The stack and auto variables .............................................................23
Dynamic memory on the heap ........................................................25
Functions ............................................................................................................. 27
Controlling functions ............................................................................27
Extended keywords for functions ......................................................27
Function storage .....................................................................................28
Special function types ..........................................................................29
Interrupt functions .............................................................................29
Monitor functions ...............................................................................30
C++ and special function types .........................................................32
Function directives .............................................................................32
Placing code and data .................................................................................... 33
Segments and memory ........................................................................33
What is a segment? ............................................................................33
Placing segments in memory ............................................................34
Customizing the linker command file ................................................35
Data segments .........................................................................................37
Static memory segments ...................................................................37
Segments for static data in the linker command file ..........................41
The data stack ....................................................................................41