ARM Technical Support Knowledge Articles

OPTIMIZED C WITH INLINE ASSEMBLER

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

I'm using inline assembly in my C program, and the code won't optimize, no matter what I do. What's going on?

ANSWER

In order to use inline assembly, you must include #pragma src in the C source file. This overrides the optimizer and generates unoptimized assembly instructions from your C code.

A better way to use assembly in conjunction with C may be found by referring to C51: CALLING ASSEMBLY ROUTINES FROM C in the database.

Article last edited on: 2004-06-07 13:00:32

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