Specifications
CAVR-4
Part 2. Compiler reference
Data representation
141
The value of a denormalized number is:
(-1)
S
* 2
(1-BIAS)
* 0.Mantissa
where BIAS is 127 and 1023 for 32-bit and 64-bit floating-point values, respectively.
Note: The IAR CLIB Library does not fully support the special cases of floating-point
numbers, such as infinity,
NaN, and subnormal numbers.
Pointer types
The AVR IAR C/C++ Compiler has two basic types of pointers: function pointers and
data pointers.
FUNCTION POINTERS
The size of function pointers is always 16 or 24 bits, and they can address the entire
memory. The internal representation of a code pointer is the actual address it refers to
divided by two.
The following function pointers are available:
DATA POINTERS
Data pointers have three sizes: 8, 16, or 24 bits. The following data pointers are
available:
Keyword Address range Pointer size Index type Description
__nearfunc 0–0x1FFFE 2 bytes signed int Can be called from any part of the
code memory, but must reside in
the first 128 Kbytes of that space.
__farfunc 0–0x7FFFFE 3 bytes signed long No restrictions on code placement.
Table 33: Function pointers
Keyword Pointer size Memory space Index type Range
__tiny 1 byte Data signed char 0x0–0xFF
__near 2 bytes Data signed int 0x0–0xFFFF
__far 3 bytes Data signed int 0x0–0xFFFFFF
(16-bit arithmetics)
__huge 3 bytes Data signed long 0x0–0xFFFFFF
__tinyflash 1 byte Code signed char 0x0–0xFF
__flash 2 bytes Code signed int 0x0–0xFFFF
Table 34: Data pointers