2007-12-07 04:44 AM
Multiple inline Assembler-Commands with IAR
2011-05-17 12:48 AM
Hi
I want to execute multiple inline-assembler-commandos one after another, so i tried it this way: static inline int FASTABS(int x) { int t=0; asm ('' eor t, x, x, asr #31 '' ''sub t, t, x, asr #31 ''); return t; } Unfortunately the IAR Embedded Workbench says Error[Og005]: Unknown symbol in inline assembly: ''t'' Error[Og005]: Unknown symbol in inline assembly: ''x'' Error[Og006]: Syntax error in inline assembly: ''Error[0]: Invalid syntax'' ... Thank you in advance2011-05-17 12:48 AM
Hi,
You can use inline assembly if you don't reference any symbols because there are several limitations to using inline assembler: -Auto variables cannot be accessed - Alternative register names, mnemonics, and operators are not supported -... So, ''Inline assembler is therefore often best avoided. If there is no suitable intrinsic function available, we recommend the use of modules written in assembler language instead of inline assembler, because the function call to an assembler routine normally causes less performance reduction.'' from EWARM compiler reference guide. For more information, refer to EWARM compiler reference guide(Mixing C and assembler page 69)