Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
82
Added C functionality
AVR® IAR C/C++ Compiler
Reference Guide
This lets the system startup code specify code in subsequent segment parts and modules 
that are designed so that some of the parts may not be included by XLINK. The code 
simply falls through to the next piece of code not discarded by the linker. The following 
example shows this technique:
    MODULE  doSomething
    RSEG    MYSEG:CODE:NOROOT(1)    // First segment part.
    PUBLIC  ?do_something
    EXTERN  ?end_of_test
    REQUIRE ?end_of_test
?do_something:  // This will be included if someone refers to
    ...         // ?do_something. If this is included then
                // the REQUIRE directive above ensures that
                // the JUMP instruction below is included.
    JMP  ?end_of_test
    RSEG    MYSEG:CODE:NOROOT(1)    // Second segment part.
    PUBLIC  ?do_something_else
?do_something_else:
    ...     // This will only be included in the linked
            // application if someone outside this function
            // refers to or requires ?do_something_else
    RSEG    MYSEG:CODE:NOROOT(1)    // Third segment part.
    PUBLIC  ?end_of_test
?end_of_test:
    RET            // This is included if ?do_something above
                   // is included.
    ENDMOD
Added C functionality
The IAR DLIB Library includes some added C functionality, partly taken from the C99 
standard.
The following include files provide these features:
stdint.h
stdbool.h
math.h
stdio.h