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.27 Inline assembler BL and SVC output value list in C and C++ code<br />

The BL and SVC instructions of <strong>the</strong> inline assembler have <strong>the</strong> following <strong>for</strong>mat:<br />

SVC{cond} svc_num, {input_param_list}, {output_value_list}, {corrupt_reg_list}<br />

BL{cond} function, {input_param_list}, {output_value_list}, {corrupt_reg_list}<br />

output_value_list specifies <strong>the</strong> physical registers that contain <strong>the</strong> output values from <strong>the</strong> BL or<br />

SVC instruction and where <strong>the</strong>y must be stored. The output values are specified as assignments<br />

from physical registers to modifiable lvalue expressions or as single physical register names.<br />

The inline assembler takes <strong>the</strong> values from <strong>the</strong> specified physical registers and assigns <strong>the</strong>m into<br />

<strong>the</strong> specified expressions. A physical register name specified without assignment causes <strong>the</strong><br />

virtual register of <strong>the</strong> same name to be updated with <strong>the</strong> value from <strong>the</strong> physical register.<br />

For example, <strong>the</strong> instruction:<br />

BL foo, { }, { result1=r0, r1 }<br />

generates <strong>the</strong> following pseudocode:<br />

BL foo MOV result1, (physical) r0 MOV (virtual) r1, (physical) r1<br />

By default, if you do not specify any output_value_list output values, register r0 is used <strong>for</strong><br />

<strong>the</strong> output value.<br />

Note<br />

It is not possible to specify <strong>the</strong> lr, sp, or pc registers in <strong>the</strong> output value list.<br />

7.27.1 See also<br />

Concepts<br />

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

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!