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.

Application Level Memory Model<br />

The big-endian <strong>and</strong> little-endian mapping schemes determine the order in which the bytes of a word or<br />

halfword are interpreted. For example, a load of a word (4 bytes) from address 0x1000 always results in an<br />

access of the bytes at memory locations 0x1000, 0x1001, 0x1002, <strong>and</strong> 0x1003. The endianness mapping scheme<br />

determines the significance of these four bytes.<br />

A3.3.1 Control of the endianness mapping scheme in <strong>ARM</strong>v7<br />

In <strong>ARM</strong>v7-A, the mapping of instruction memory is always little-endian. In <strong>ARM</strong>v7-R, instruction<br />

endianness can be controlled at the system level, see Instruction endianness.<br />

For information about data memory endianness control, see ENDIANSTATE on page A2-19.<br />

Note<br />

Versions of the <strong>ARM</strong> architecture before <strong>ARM</strong>v7 had a different mechanism to control the endianness, see<br />

Endian configuration <strong>and</strong> control on page AppxG-20.<br />

A3.3.2 Instruction endianness<br />

Table A3-4 Little-endian memory system<br />

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

Word at Address A<br />

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

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

Before <strong>ARM</strong>v7, the <strong>ARM</strong> architecture included legacy support for an alternative big-endian memory model,<br />

described as BE-32 <strong>and</strong> controlled by the B bit, bit [7], of the SCTLR, see c1, System Control Register<br />

(SCTLR) on page AppxG-34. <strong>ARM</strong>v7 does not support BE-32 operation, <strong>and</strong> bit [7] of the SCTLR is RAZ.<br />

Where legacy object code for <strong>ARM</strong> processors contains instructions with a big-endian byte order, the<br />

removal of support for BE-32 operation requires the instructions in the object files to have their bytes<br />

reversed for the code to be executed on an <strong>ARM</strong>v7 processor. This means that:<br />

each Thumb instruction, whether a 32-bit Thumb instruction or a 16-bit Thumb instruction, must<br />

have the byte order of each halfword of instruction reversed<br />

each <strong>ARM</strong> instruction must have the byte order of each word of instruction reversed.<br />

For most situations, this can be h<strong>and</strong>led in the link stage of a tool-flow, provided the object files include<br />

sufficient information to permit this to happen. In practice, this is the situation for all applications with the<br />

<strong>ARM</strong>v7-A profile.<br />

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

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

Saved successfully!

Ooh no, something went wrong!