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.29 Inline assembler branches and labels in C and C++ code<br />

Labels defined in inline assembly code:<br />

• can be used as targets <strong>for</strong> branches or C and C++ goto statements<br />

• must be followed by a colon, :, like C and C++ labels<br />

• must be within <strong>the</strong> same function that <strong>the</strong>y are called from.<br />

Labels defined in C and C++ can be used as targets by branch instructions in inline assembly<br />

code, in <strong>the</strong> <strong>for</strong>m:<br />

B{cond} label<br />

For example:<br />

int foo(int x, int y)<br />

{<br />

__asm<br />

{<br />

SUBS x,x,y<br />

BEQ end<br />

}<br />

return 1;<br />

}<br />

end:<br />

return 0;<br />

7.29.1 See also<br />

Concepts<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-34<br />

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!