05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

I.4 Expressions<br />

This section describes:<br />

General expression syntax<br />

Operators <strong>and</strong> functions - polymorphism <strong>and</strong> prototypes on page AppxI-10<br />

Precedence rules on page AppxI-10.<br />

I.4.1 General expression syntax<br />

An expression is one of the following:<br />

a constant<br />

a variable, optionally preceded by a data type name to declare its type<br />

the word UNKNOWN preceded by a data type name to declare its type<br />

the result of applying a language-defined operator to other expressions<br />

the result of applying a function to other expressions.<br />

Pseudocode Definition<br />

Variable names normally consist of alphanumeric <strong>and</strong> underscore characters, starting with an alphabetic or<br />

underscore character.<br />

Each register described in the text is to be regarded as declaring a correspondingly named bitstring variable,<br />

<strong>and</strong> that variable has the stated behavior of the register. For example, if a bit of a register is defined as<br />

RAZ/WI, then the corresponding bit of its variable reads as 0 <strong>and</strong> ignore writes.<br />

An expression like bits(32) UNKNOWN indicates that the result of the expression is a value of the given type,<br />

but the architecture does not specify what value it is <strong>and</strong> software must not rely on such values. The value<br />

produced must not constitute a security hole <strong>and</strong> must not be promoted as providing any useful information<br />

to software. (This was called an UNPREDICTABLE value in previous <strong>ARM</strong> architecture documentation. It is<br />

related to but not the same as UNPREDICTABLE, which says that the entire architectural state becomes<br />

similarly unspecified.)<br />

A subset of expressions are assignable. That is, they can be placed on the left-h<strong>and</strong> side of an assignment.<br />

This subset consists of:<br />

Variables<br />

The results of applying some operators to other expressions. The description of each<br />

language-defined operator that can generate an assignable expression specifies the circumstances<br />

under which it does so. (For example, those circumstances might include one or more of the<br />

expressions the operator operates on themselves being assignable expressions.)<br />

The results of applying array-like functions to other expressions. The description of an array-like<br />

function specifies the circumstances under which it can generate an assignable expression.<br />

Every expression has a data type. This is determined by:<br />

For a constant, the syntax of the constant.<br />

For a variable, there are three possible sources for the type<br />

— its optional preceding data type name<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. AppxI-9

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

Saved successfully!

Ooh no, something went wrong!