Specifications
CAVR-4
206
Descriptions of extended keywords
AVR® IAR C/C++ Compiler
Reference Guide
__ext_io
Controls the storage of data objects in data memory space.
The
__ext_io memory attribute implies that objects are __no_init and volatile, and
allows objects to be accessed by use of the special I/O instructions in the AVR
microcontroller.
Your application may access the AVR I/O system by using the memory-mapped internal
special function registers (SFRs). To access the AVR I/O system efficiently, the
__ext_io memory attribute should be included in the code.
__far
Controls the storage of data objects in data memory space.
The
__far memory attribute overrides the default data storage of variables given by the
selected memory model.
Note: When the
__far memory attribute is used, the object cannot cross a 64-Kbyte
boundary. Arithmetics will only be performed on the two lower bytes, except
comparison which is always performed on the entire 24-bit address.
__farflash
Controls the storage of data objects in flash (code) memory space.
The
__farflash memory attribute places objects in flash (code) memory.
Note that it is preferable to declare flash objects as
const. The __farflash memory
attribute is only available for AVR chips with at least 64 Kbytes of flash memory.
The index type uses 16-bit arithmetic, which implies that a 64-Kbyte boundary cannot
be crossed.
Note: When the
__farflash memory attribute is used, the object cannot cross a
64-Kbyte boundary. Arithmetics will only be performed on the two lower bytes, except
comparison which is always performed on the entire 24-bit address.
Address range Max object size Pointer size Memory space
0x100-0xFFFF 4 bytes (32 bits) Pointers not allowed Data
Table 56: Near address ranges
Address range Max object size Pointer size Memory space
0-0xFFFFFF (16 Mbytes) 65535 bytes 24 bits Data
Table 57: Far address ranges
Address range Max object size Pointer size Memory space
0-0x7FFFFF (8 Mbytes) 65535 bytes 24 bits Code
Table 58: Farflash address ranges