Atmel CAVR-4 Manual De Usuario
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
CAVR-4
Part 2. Compiler reference
Extended keywords
213
_ _task
Allows functions to exit without restoring registers. This keyword is typically used for
the
the
main
function.
By default, functions save the contents of used non-scratch registers (permanent
registers) on the stack upon entry, and restore them at exit. Functions declared as
registers) on the stack upon entry, and restore them at exit. Functions declared as
_ _task
do not save any registers, and therefore require less stack space. Such functions
should only be called from assembler routines.
The function
main
may be declared
_ _task
, unless it is explicitly called from the
application. In real-time applications with more than one task, the root function of each
task may be declared
task may be declared
_ _task
.
The keyword is placed in front of the return type, for instance:
_ _task void my_handler(void);
The
#pragma
type_attribute
directive can also be used. The following declaration
of
my_handler
is equivalent with the previous one:
#pragma type_attribute=_ _task
void my_handler(void);
The
_ _task
keyword must be specified both in the function declaration and when the
function is defined.
_ _tiny
Controls the storage of data objects in data memory space.
The
_ _tiny
memory attribute overrides the default data storage of variables given by
the selected memory model.
_ _tinyflash
Controls the storage of data objects in flash (code) memory space.
The
_ _tinyflash
memory attribute places objects in flash (code) memory.
Note that it is preferable to declare flash objects as constant.
Address range
Max object size
Pointer size
Memory space
0-0xFF
(256 bytes)
255 bytes
8 bits
Data
Table 67: Tiny address ranges
Address range
Max object size
Pointer size
Memory space
0-0xFF
(256 bytes)
255 bytes
8 bits
Code
Table 68: Tinyflash address ranges