11.07.2015 Views

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVRusing <strong>the</strong> same example as be<strong>for</strong>e, you can write <strong>the</strong> following in an assembly file:.area battery_sram(abs).org 0x4000_var1:: .blkw 1 ; note _ in <strong>the</strong> front_var2:: .blkb 1 ; <strong>and</strong> two colonsThe (abs) attribute tells <strong>the</strong> assembler that <strong>the</strong> area does not need relocation<strong>and</strong> it is valid to use <strong>the</strong> .org directive in <strong>the</strong> area. In this example, we use .orgto set <strong>the</strong> starting address. In C <strong>the</strong> declaration will be exactly <strong>the</strong> same as be<strong>for</strong>e.If you have data that have initialized values, <strong>the</strong>n you can also use <strong>the</strong> followingpragma in C to define <strong>the</strong>m (note this only works with data that have initializedvalues):#pragma abs_address:0x4000int var1 = 5;char var2 = 0;#pragma end_abs_address151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!