04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

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.

Compiler-specific Features<br />

4.9 Named register variables<br />

The compiler enables you to access registers of an <strong>ARM</strong> architecture-based processor<br />

using named register variables.<br />

4.9.1 Syntax<br />

register type var-name __asm(reg);<br />

Where:<br />

type<br />

var-name<br />

reg<br />

is the type of the named register variable.<br />

Any type of the same size as the register being named can be used in the<br />

declaration of a named register variable. The type can be a structure, but<br />

bitfield layout is sensitive to endianness.<br />

is the name of the named register variable.<br />

is a character string denoting the name of a register on an <strong>ARM</strong><br />

architecture-based processor.<br />

Registers available for use with named register variables on <strong>ARM</strong><br />

architecture-based processors are shown in Table 4-22.<br />

Table 4-22 Named registers available on <strong>ARM</strong> architecture-based processors<br />

Register Character string for __asm Processors<br />

CPSR "cpsr" or "apsr" All processors<br />

BASEPRI "basepri" Cortex-M3, Cortex-M4<br />

BASEPRI_MAX "basepri_max" Cortex-M3, Cortex-M4<br />

CONTROL "control" Cortex-M0, Cortex-M1, Cortex-M3,<br />

Cortex-M4<br />

EAPSR "eapsr" Cortex-M0, Cortex-M1, Cortex-M3,<br />

Cortex-M4<br />

EPSR "epsr" Cortex-M0, Cortex-M1, Cortex-M3,<br />

Cortex-M4<br />

FAULTMASK "faultmask" Cortex-M3, Cortex-M4<br />

IAPSR "iapsr" Cortex-M0, Cortex-M1, Cortex-M3,<br />

Cortex-M4<br />

4-192 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!