Programmer’s Model

2.5Memory formats

The processor views memory as a linear collection of bytes numbered in ascending order from zero. For example, bytes 0-3 hold the first stored word, and bytes 4-7 hold the second stored word.

The processor can treat words of data in memory as being stored in either:

Byte-invariantbig-endian format

Little-endian format.

Additionally, the processor supports mixed-endian and unaligned data accesses. For more information, see the ARM Architecture Reference Manual.

2.5.1Byte-invariant big-endian format

In byte-invariant big-endian (BE-8) format, the processor stores the most significant byte of a word at the lowest-numbered byte, and the least significant byte at the highest-numbered byte. Figure 2-1shows byte-invariant big-endian (BE-8) format.

Address

A[31:0]

+1

+2

+3

Memory

70

B0

msbyte

B1

 

B2

 

B3

lsbyte

Register

31

24 23

16 15

8

7

0

B0

 

 

B1

 

B2

 

B3

 

 

 

 

 

 

 

 

Figure 2-1 Byte-invariant big-endian (BE-8) format

2.5.2Little-endian format

In little-endian format, the lowest-numbered byte in a word is the least significant byte of the word and the highest-numbered byte is the most significant. Figure 2-2shows little-endian format.

Memory

Address

A[31:0]

7

0

 

 

 

 

 

 

b0

lsbyte

+1

b1

 

+2

b2

 

+3 b3 msbyte

Register

31

24 23

16 15

8

7

0

b3

 

 

b2

 

b1

 

b0

 

 

 

 

 

 

 

 

Figure 2-2 Little-endian format

ARM DDI 0363E

Copyright © 2009 ARM Limited. All rights reserved.

2-6

ID013010

Non-Confidential, Unrestricted Access

 

Page 52
Image 52
ARM R4F, r1p3 Memory formats, Byte-invariantbig-endian format Little-endian format, Byte-invariant big-endian format