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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVRComm<strong>and</strong>sA comm<strong>and</strong> can be an AVR instruction, an assembler directive or a macro invocation.The oper<strong>and</strong>s field denotes <strong>the</strong> oper<strong>and</strong>s needed <strong>for</strong> <strong>the</strong> comm<strong>and</strong>. This page doesnot describe <strong>the</strong> AVR instructions per se, since <strong>the</strong> assembler uses <strong>the</strong> st<strong>and</strong>ardvendor-defined names; consult <strong>the</strong> vendor’s documentation <strong>for</strong> instructiondescriptions.The exceptions are: xcall Applicable to mega devices that support long call or jump instructionsonly. This is translated to ei<strong>the</strong>r to rcall or call, depending on <strong>the</strong> location of<strong>the</strong> target label. xjmp Applicable to mega devices that support long call or jump instructionsonly. This is translated to ei<strong>the</strong>r to rjmp or jmp, depending on <strong>the</strong> location of <strong>the</strong>target label.ExpressionsAn instruction oper<strong>and</strong> may involve an expression. For example, <strong>the</strong> direct addressingmode is simply an expression:lds R10,asymbolThe expression asymbol is an example of <strong>the</strong> simplest expression, which is just asymbol or label name. In general, an expression is described by:expr: term | ( expr ) | unop expr | expr binop exprterm: . | name | #nameThe dot (.) is <strong>the</strong> current program counter. Paren<strong>the</strong>ses () provide grouping.Operator precedence is given below. Expressions cannot be arbitrarily complex, dueto <strong>the</strong> limitations of relocation in<strong>for</strong>mation communicated to <strong>the</strong> linker. The basic rule isthat <strong>for</strong> an expression, <strong>the</strong>re can only be only one relocatable symbol. For example,lds R10,foo+baris invalid if both foo <strong>and</strong> bar are external symbols.OperatorsThe following is <strong>the</strong> list of <strong>the</strong> operators <strong>and</strong> <strong>the</strong>ir precedence. Operators with higherprecedence are applied first. Only <strong>the</strong> addition operator may apply to a relocatablesymbol (such as an external symbol). All o<strong>the</strong>r operators must be applied to constantsor symbols resolvable by <strong>the</strong> assembler (such as a symbol defined in <strong>the</strong> file).181

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

Saved successfully!

Ooh no, something went wrong!