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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I.3 Data types<br />

This section describes:<br />

General data type rules<br />

Bitstrings<br />

Integers on page AppxI-6<br />

Reals on page AppxI-6<br />

Booleans on page AppxI-6<br />

Enumerations on page AppxI-6<br />

Lists on page AppxI-7<br />

Arrays on page AppxI-8.<br />

I.3.1 General data type rules<br />

Pseudocode Definition<br />

<strong>ARM</strong> architecture pseudocode is a strongly-typed language. Every constant <strong>and</strong> variable is of one of the<br />

following types:<br />

bitstring<br />

integer<br />

boolean<br />

real<br />

enumeration<br />

list<br />

array.<br />

The type of a constant is determined by its syntax. The type of a variable is normally determined by<br />

assignment to the variable, with the variable being implicitly declared to be of the same type as whatever is<br />

assigned to it. For example, the assignments x = 1, y = '1', <strong>and</strong> z = TRUE implicitly declare the variables<br />

x, y <strong>and</strong> z to have types integer, length-1 bitstring <strong>and</strong> boolean respectively.<br />

Variables can also have their types declared explicitly by preceding the variable name with the name of the<br />

type. This is most often done in function definitions for the arguments <strong>and</strong> the result of the function.<br />

These data types are described in more detail in the following sections.<br />

I.3.2 Bitstrings<br />

A bitstring is a finite-length string of 0s <strong>and</strong> 1s. Each length of bitstring is a different type. The minimum<br />

permitted length of a bitstring is 1.<br />

The type name for bitstrings of length N is bits(N). A synonym of bits(1) is bit.<br />

Bitstring constants are written as a single quotation mark, followed by the string of 0s <strong>and</strong> 1s, followed by<br />

another single quotation mark. For example, the two constants of type bit are '0' <strong>and</strong> '1'. Spaces can be<br />

included in bitstrings for clarity.<br />

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

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

Saved successfully!

Ooh no, something went wrong!