Atmel CAVR-4 ユーザーズマニュアル
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
CAVR-4
16
Introduction
AVR® IAR C/C++ Compiler
Reference Guide
●
On the heap. Once memory has been allocated on the heap, it remains valid until it
is explicitly released back to the system by the application. This type of memory is
useful when the number of objects is not known until the application executes. Note
that there are potential risks connected with using the heap in systems with a limited
amount of memory, or systems that are expected to run for a long time.
is explicitly released back to the system by the application. This type of memory is
useful when the number of objects is not known until the application executes. Note
that there are potential risks connected with using the heap in systems with a limited
amount of memory, or systems that are expected to run for a long time.
EXTENDED KEYWORDS FOR DATA
The extended keywords that can be used for data control the following:
●
For data memory space, keywords that control the placement and type of objects
and pointers:
and pointers:
_ _tiny
,
_ _near
,
_ _far
,
_ _huge
, and
_ _regvar
●
For the EEPROM memory space, keyword that controls the placement and type of
objects and pointers:
objects and pointers:
_ _eeprom
●
For the code (flash) memory space, keywords that control the placement and type of
objects and pointers:
objects and pointers:
_ _tinyflash
,
_ _flash
,
_ _farflash
, and
_ _hugeflash
●
For the I/O memory space, keyword that controls the placement and type of objects
and pointers:
and pointers:
_ _ext_io
,
_ _io
●
Special pointer that can access data objects in both data and code memory space:
_ _generic
●
Other characteristics of objects:
_ _root
and
_ _no_init
.
See the chapter Data storage in Part 1. Using the compiler for more information about
how to use data memory types.
how to use data memory types.
Syntax
The keywords follow the same syntax as the type qualifiers
const
and
volatile
. The
following declarations place the variable
i
and
j
in EEPROM memory. The variables
k
and
l
behave in the same way:
_ _eeprom int i, j;
int _ _eeprom k, l;
Note that the keyword affects both identifiers.
In addition to the rules presented here—to place the keyword directly in the code—the
directives
directives
#pragma
type_attribute
and
#pragma
object_attribute
can be used
for specifying the keywords. Refer to the chapter Pragma directives for details about
how to use the extended keywords together with pragma directives.
how to use the extended keywords together with pragma directives.
Pointers
A keyword that is followed by an asterisk (
*
), affects the type of the pointer being
declared. A pointer to EEPROM memory is thus declared by:
char _ _eeprom * p;