ARM Technical Support Knowledge Articles

STRANGE ERRORS WITH IN-LINE ASSEMBLER CODE

Applies to: General Topics

Answer


Information in this article applies to:


QUESTION

I am using the following in-line assembler statements, but I get:

void myfunc (void) {
#pragma ASM
; My comment in assembler
  mov a, #0   ; I'm using another comment
#pragma ENDASM
}

When I compile this code I get error messages like:

*** ERROR C305: unterminated string/char const

What can be the reason for this error?

ANSWER

Even in in-line assembler sections, you need to use the ANSI C style for comments. When you re-write your program as shown below everything will compile as expected:

void myfunc (void) {
#pragma ASM
/* My comment in assembler */
  mov a, #0   // I'm using another comment
#pragma ENDASM
}

Article last edited on: 2004-11-12 16:21:49

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential