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.

A3.3 Endian support<br />

The rules in Address space on page A3-2 require that for a word-aligned address A:<br />

the word at address A consists of the bytes at addresses A, A+1, A+2 <strong>and</strong> A+3<br />

the halfword at address A consists of the bytes at addresses A <strong>and</strong> A+1<br />

the halfword at address A+2 consists of the bytes at addresses A+2 <strong>and</strong> A+3.<br />

the word at address A therefore consists of the halfwords at addresses A <strong>and</strong> A+2.<br />

Application Level Memory Model<br />

However, this does not specify completely the mappings between words, halfwords, <strong>and</strong> bytes.<br />

A memory system uses one of the two following mapping schemes. This choice is known as the endianness<br />

of the memory system.<br />

In a little-endian memory system:<br />

the byte or halfword at a word-aligned address is the least significant byte or halfword in the word at<br />

that address<br />

the byte at a halfword-aligned address is the least significant byte in the halfword at that address.<br />

In a big-endian memory system:<br />

the byte or halfword at a word-aligned address is the most significant byte or halfword in the word at<br />

that address<br />

the byte at a halfword-aligned address is the most significant byte in the halfword at that address.<br />

For a word-aligned address A, Table A3-3 <strong>and</strong> Table A3-4 on page A3-8 show the relationship between:<br />

the word at address A<br />

the halfwords at addresses A <strong>and</strong> A+2<br />

the bytes at addresses A, A+1, A+2 <strong>and</strong> A+3.<br />

Table A3-3 shows this relationship for a big-endian memory system, <strong>and</strong> Table A3-4 on page A3-8 shows<br />

the relationship for a little-endian memory system.<br />

Table A3-3 Big-endian memory system<br />

MSByte MSByte - 1 LSByte + 1 LSByte<br />

Word at Address A<br />

Halfword at Address A Halfword at Address A+2<br />

Byte at Address A Byte at Address A+1 Byte at Address A+2 Byte at Address A+3<br />

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

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

Saved successfully!

Ooh no, something went wrong!