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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

7.1 <strong>Compiler</strong> support <strong>for</strong> inline assembly language<br />

The compiler provides an inline assembler that enables you to write optimized assembly<br />

language routines, and to access features of <strong>the</strong> target processor not available from C or C++.<br />

See <strong>the</strong> following topics:<br />

• Inline assembler support in <strong>the</strong> compiler on page 7-5<br />

• Restrictions on inline assembler support in <strong>the</strong> compiler on page 7-6<br />

• Inline assembly language syntax with <strong>the</strong> __asm keyword in C and C++ on page 7-7<br />

• Inline assembly language syntax with <strong>the</strong> asm keyword in C++ on page 7-8<br />

• Inline assembler rules <strong>for</strong> compiler keywords __asm and asm on page 7-9<br />

• Restrictions on inline assembly operations in C and C++ code on page 7-11<br />

• Inline assembler and register access in C and C++ code on page 7-18<br />

• Inline assembler and <strong>the</strong> # constant expression specifier in C and C++ code on page 7-20<br />

• Inline assembler and instruction expansion in C and C++ code on page 7-21<br />

• Inline assembler effect on processor condition flags in C and C++ code on page 7-24<br />

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

• Inline assembler function calls and branches in C and C++ code on page 7-29<br />

• Inline assembler branches and labels in C and C++ code on page 7-34.<br />

For in<strong>for</strong>mation on how to use register variables as an alternative to some uses of inline<br />

assembly language:<br />

• <strong>Compiler</strong> Reference:<br />

— Named register variables on page 5-94.<br />

For in<strong>for</strong>mation on how to use <strong>the</strong> inline assembler in C and C++ source code, and restrictions<br />

on inline assembly language:<br />

For more in<strong>for</strong>mation on writing assembly language <strong>for</strong> <strong>ARM</strong> processors:<br />

• <strong>Using</strong> <strong>the</strong> Assembler.<br />

For in<strong>for</strong>mation on significant differences that apply between RVCT and <strong>ARM</strong> <strong>Compiler</strong> 4.1:<br />

• Migration and Compatibility:<br />

— Chapter 2 Migrating from RVCT v4.0 <strong>for</strong> µVision to <strong>ARM</strong> <strong>Compiler</strong> <strong>v4.1</strong> <strong>for</strong><br />

µVision.<br />

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

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!