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 AVRNote <strong>the</strong> interface convention of prefixing an external variable names with an '_' in <strong>the</strong>assembler file <strong>and</strong> <strong>the</strong> use of two colons to define <strong>the</strong>m as global variables.Using Inline AsmInline asm is really just <strong>the</strong> same as regular assembler syntax except it is enclosed in<strong>the</strong> pseudo-function asm(). In a C file, <strong>the</strong> preceding assembly code becomes:asm(“.area memory(abs)\n”“.org 0x1000\n”“_LCD_control_register:: .blkw 1\n”“_LCD_data_register:: .blkw 1");asm(“.org 0x2000\n”“_dual_port_SRAM:: .blkb 100");Note <strong>the</strong> use of \n to separate <strong>the</strong> lines. You still need to declare <strong>the</strong>se as extern inC (as in <strong>the</strong> preceding example), just as in <strong>the</strong> case of using a separate assembler file,since <strong>the</strong> C <strong>compiler</strong> does not really know what's inside <strong>the</strong> asm statements.126

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

Saved successfully!

Ooh no, something went wrong!