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.38 Manual overload resolution in embedded assembler<br />

Example 7-4 shows <strong>the</strong> use of C++ casts to do overload resolution <strong>for</strong> nonvirtual function calls:<br />

Example 7-4 C++ casts<br />

void g(int);<br />

void g(long);<br />

struct T<br />

{<br />

int mf(int);<br />

int mf(int,int);<br />

};<br />

__asm void f(T*, int, int)<br />

{<br />

BL __cpp(static_cast(&T::mf)) // calls T::mf(int, int)<br />

BL __cpp(static_cast(g)) // calls g(int)<br />

BX lr<br />

}<br />

7.38.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-45<br />

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!