29.10.2014 Views

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

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.

<strong>Using</strong> <strong>the</strong> Inline and Embedded Assemblers of <strong>the</strong> <strong>ARM</strong> <strong>Compiler</strong><br />

7.19 Inline assembler effect on processor condition flags in C and C++ code<br />

An inline assembly language instruction might explicitly or implicitly attempt to update <strong>the</strong><br />

processor condition flags. Inline assembly language instructions that involve only virtual<br />

register operands or simple expression operands have predictable behavior. The condition flags<br />

are set by <strong>the</strong> instruction if ei<strong>the</strong>r an implicit or an explicit update is specified. The condition<br />

flags are unchanged if no update is specified. If any of <strong>the</strong> instruction operands are not simple<br />

operands, <strong>the</strong>n <strong>the</strong> condition flags might be corrupted unless <strong>the</strong> instruction updates <strong>the</strong>m. In<br />

general, <strong>the</strong> compiler cannot easily diagnose potential corruption of <strong>the</strong> condition flags.<br />

However, <strong>for</strong> operands that require <strong>the</strong> construction and subsequent destruction of C++<br />

temporaries <strong>the</strong> compiler gives a warning if <strong>the</strong> instruction attempts to update <strong>the</strong> condition<br />

flags. This is because <strong>the</strong> destruction might corrupt <strong>the</strong> condition flags.<br />

7.19.1 See also<br />

Concepts<br />

• Inline assembler expression operands in C and C++ code on page 7-26<br />

• Inline assembler operands in C and C++ code on page 7-25<br />

• <strong>Compiler</strong> support <strong>for</strong> inline assembly language on page 7-4.<br />

<strong>ARM</strong> DUI 0375C Copyright © 2007-2008, 2011 <strong>ARM</strong>. All rights reserved. 7-24<br />

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!