Messages Og005 and Og006 when using inline assembler

Technical Note 31237

Targets:
ARM, AVR, AVR32

Component:
Compiler

Updated:
4/3/2013 2:11 PM

Introduction

When compiling a project the following messages might appear:

Error[Og005]: Unknown symbol in inline assembly:
Error[Og006]: Syntax error in inline assembly: "Error[54]: Expression can not be forward"

Solution

Labels must be referred in the same assembler statement as they are declared. Use multiline inline assembler (with row breaks \n) to solve this.

Example:

asm("st      -Y,  R20\n  \n"
"spmloop: \n"
"lN R20, 0x37 \n"
"SBRC R20, 0 \n"
"RJMP spmloop \n"
"OUT 0x37,R25 \n"
"SPM \n"
"LD R20,Y+ \n");

The behavior was not correct in earlier versions of the compiler platform. The new release uses a new internal compiler platform which is a bit more strict.


All product names are trademarks or registered trademarks of their respective owners.

Related Tech Notes

© IAR Systems 1995-2016 - All rights reserved.