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.28 Inline assembler BL and SVC corrupted register list<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 />

corrupt_reg_list specifies <strong>the</strong> physical registers that are corrupted by <strong>the</strong> called function. If <strong>the</strong><br />

condition flags are modified by <strong>the</strong> called function, you must specify <strong>the</strong> PSR in <strong>the</strong> corrupted<br />

register list.<br />

The BL and SVC instructions always corrupt lr.<br />

If corrupt_reg_list is omitted <strong>the</strong>n <strong>for</strong> BL and SVC, <strong>the</strong> registers r0-r3, lr and <strong>the</strong> PSR are<br />

corrupted.<br />

Only <strong>the</strong> branch instruction, B, can be used to jump to labels within a single C or C++ function.<br />

By default, if you do not specify any corrupt_reg_list registers, r0 to r3, r14, and <strong>the</strong> PSR can<br />

be corrupted.<br />

Note<br />

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

7.28.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-33<br />

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!