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.33 Effect of compiler <strong>ARM</strong> and Thumb states on embedded assembler<br />

The initial state of <strong>the</strong> embedded assembler, <strong>ARM</strong> or Thumb state, is determined by <strong>the</strong> initial<br />

state of <strong>the</strong> compiler, as specified on <strong>the</strong> command line. This means that:<br />

• if <strong>the</strong> compiler starts in <strong>ARM</strong> state, <strong>the</strong> embedded assembler uses --arm<br />

• if <strong>the</strong> compiler starts in Thumb state, <strong>the</strong> embedded assembler uses --thumb.<br />

The embedded assembler state at <strong>the</strong> start of each function is as set by <strong>the</strong> invocation of <strong>the</strong><br />

compiler, as modified by #pragma arm and #pragma thumb pragmas.<br />

You can change <strong>the</strong> state of <strong>the</strong> embedded assembler within a function by using explicit <strong>ARM</strong>,<br />

THUMB, or CODE16 directives in <strong>the</strong> embedded assembler function. Such a directive within an __asm<br />

function does not affect <strong>the</strong> <strong>ARM</strong> or Thumb state of subsequent __asm functions.<br />

If you are compiling <strong>for</strong> a Thumb-2 capable processor, you can use Thumb-2 instructions when<br />

in Thumb state.<br />

7.33.1 See also<br />

Concepts<br />

• <strong>Compiler</strong> support <strong>for</strong> embedded assembler on page 7-36.<br />

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

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!