Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CS 220 / ARM / ARM1176JZ-S Technical Reference Mmanual.pdf
Источник:
Скачиваний:
48
Добавлен:
16.04.2015
Размер:
4.47 Mб
Скачать

Unaligned and Mixed-endian Data Access Support

4.3Endian support

The architectural specification of unaligned data representations is defined in terms of bytes transferred between memory and register, regardless of bus width and bus endianness.

Little-endian data items are described using lower-case byte labeling bX…b0, byteX to byte 0, and a pointer is always treated as pointing to the least significant byte of the addressed data.

Byte invariant, BE-8, big-endian data items are described using upper-case byte labeling B0…BX, BYTE0 to BYTEX, and a pointer is always treated as pointing to the most significant byte of the addressed data.

4.3.1Load unsigned byte, endian independent

The addressed byte is loaded from memory into the low eight bits of the general-purpose register and the upper 24 bits are zeroed, as Figure 4-1 shows.

Memory

Register

Address

7

0

A[31:0]

 

 

 

 

b

31

23

15

7

0

0 0 0 b

Figure 4-1 Load unsigned byte

4.3.2Load signed byte, endian independent

The addressed byte is loaded from the memory into the low eight bits of the general-purpose register and the sign bit is extended into the upper 24 bits of the register as Figure 4-2 shows.

Memory

Register

Address

7

0

A[31:0]

 

 

 

 

b

31

23

15

7

0

se se se b

Figure 4-2 Load signed byte

In Figure 4-2, se means b, bit [7], sign extension.

4.3.3Store byte, endian independent

The low eight bits of the general-purpose register are stored into the addressed byte in memory, as Figure 4-3 on page 4-7 shows.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

4-6

ID012410

Non-Confidential, Unrestricted Access

 

Unaligned and Mixed-endian Data Access Support

Register

Memory

 

 

 

 

Address

7

0

 

 

 

 

A[31:0]

 

 

31

23

15

7

0

 

 

x

 

x

x

b

 

b

Figure 4-3 Store byte

4.3.4Load unsigned halfword, little-endian

The addressed byte-pair is loaded from memory into the low 16 bits of the general-purpose register, and the upper 16 bits are zeroed so that the least-significant addressed byte in memory appears in bits [7:0] of the ARM register, as Figure 4-4 shows.

Memory

Register

Address

7

0

A[31:0]

 

 

 

b0

lsbyte

+1

b1

msbyte

31

23

15

7

0

0 0 b1 b0

Figure 4-4 Load unsigned halfword, little-endian

If strict alignment fault checking is enabled and Address bit 0 is not zero, then a Data Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.5Load unsigned halfword, big-endian

The addressed byte-pair is loaded from memory into the low 16 bits of the general-purpose register, and the upper 16 bits are zeroed so that the most-significant addressed byte in memory appears in bits [15:8] of the ARM register, as Figure 4-5 on page 4-8 shows.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

4-7

ID012410

Non-Confidential, Unrestricted Access

 

Unaligned and Mixed-endian Data Access Support

Memory

Register

Address

7

0

A[31:0]

 

 

 

B0

msbyte

+1

B1

lsbyte

31

23

15

7

0

0 0 B0 B1

Figure 4-5 Load unsigned halfword, big-endian

If strict alignment fault checking is enabled and Address bit 0 is not zero, then a Data Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.6Load signed halfword, little-endian

The addressed byte-pair is loaded from memory into the low 16-bits of the general-purpose register, so that the least-significant addressed byte in memory appears in bits [7:0] of the ARM register and the upper 16 bits are sign-extended from bit 15, as Figure 4-6 shows.

Memory

Register

Address

7

0

A[31:0]

 

 

 

b0

lsbyte

+1

b1

msbyte

31

23

15

7

0

se1 se1 b1 b0

Figure 4-6 Load signed halfword, little-endian

In Figure 4-6, se1 means bit 15, b1 bit [7], sign extended.

If strict alignment fault checking is enabled and Address bit 0 is not zero, then a Data Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.7Load signed halfword, big-endian

The addressed byte-pair is loaded from memory into the low 16-bits of the general-purpose register, so that the most significant addressed byte in memory appears in bits [15:8] of the ARM register and bits [31:16] replicate the sign bit in bit 15, as Figure 4-7 on page 4-9 shows.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

4-8

ID012410

Non-Confidential, Unrestricted Access

 

Unaligned and Mixed-endian Data Access Support

Memory

Register

Address

7

0

A[31:0]

 

 

 

B0

msbyte

+1

B1

lsbyte

31

23

15

7

0

SE0 SE0 B0 B1

Figure 4-7 Load signed halfword, big-endian

In Figure 4-7, SE0 means bit 15, B0 bit [7], sign extended.

If strict alignment fault checking is enabled and Address bit 0 is not zero, then a Data Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.8Store halfword, little-endian

The low 16 bits of the general-purpose register are stored into the memory with bits [7:0] written to the addressed byte in memory, bits [15:8] to the incremental byte address in memory, as Figure 4-8 shows.

Register

Memory

 

 

 

 

Address

7

0

 

 

 

 

A[31:0]

 

 

31

23

15

7

0

 

 

x

 

x

b1

b0

b0

lsbyte

 

 

 

 

+1

b1

msbyte

Figure 4-8 Store halfword, little-endian

If strict alignment fault checking is enabled and Address bit 0 is not zero, then a Data Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.9Store halfword, big-endian

The low 16 bits of the general-purpose register are stored into the memory with bits [15:8] written to the addressed byte in memory, bits [7:0] to the incremental byte address in memory, as Figure 4-9 on page 4-10 shows.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

4-9

ID012410

Non-Confidential, Unrestricted Access

 

Unaligned and Mixed-endian Data Access Support

 

 

 

 

Register

 

 

Memory

 

 

 

 

 

 

 

 

 

Address

7

0

 

 

 

 

 

 

 

 

 

A[31:0]

 

 

 

 

31

23

15

7

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x

 

 

x

 

B0

 

B1

 

 

B0

 

msbyte

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+1

 

B1

 

lsbyte

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 4-9 Store halfword, big-endian

If strict alignment fault checking is enabled and Address bit 0 is not zero, then a Data Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.10Load word, little-endian

The addressed byte-quad is loaded from memory into the 32-bit general-purpose register so that the least-significant addressed byte in memory appears in bits [7:0] of the ARM register, as Figure 4-10 shows.

Memory

Register

Address

7

0

A[31:0]

 

 

 

b0

lsbyte

+1

b1

 

+2

b2

 

+3

b3

msbyte

31

23

15

7

0

b3 b2 b1 b0

Figure 4-10 Load word, little-endian

If strict alignment fault checking is enabled and Address bits [1:0] are not zero, then a Data

Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.11Load word, big-endian

The addressed byte-quad is loaded from memory into the 32-bit general-purpose register so that the most significant addressed byte in memory appears in bits [31:24] of the ARM register, as Figure 4-11 on page 4-11 shows.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

4-10

ID012410

Non-Confidential, Unrestricted Access

 

 

Unaligned and Mixed-endian Data Access Support

 

Memory

 

Register

 

Address

7

0

 

 

 

 

A[31:0]

 

 

 

 

 

 

 

 

31

23

15

7

0

 

B0

msbyte

B0

B1

B2

B3

+1

B1

 

 

 

 

 

+2

B2

 

 

 

 

 

+3

B3

lsbyte

 

 

 

 

Figure 4-11 Load word, big-endian

If strict alignment fault checking is enabled and Address bits [1:0] are not zero, then a Data

Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.12Store word, little-endian

The 32-bit general-purpose register is stored to four bytes in memory where bits [7:0] of the ARM register are transferred to the least-significant addressed byte in memory, as Figure 4-12 shows.

 

 

Register

 

Memory

 

 

 

 

Address

7

0

 

 

 

 

A[31:0]

 

 

31

23

15

7

0

 

 

b3

 

b2

b1

b0

b0

lsbyte

 

 

 

 

+1

b1

 

 

 

 

 

+2

b2

 

 

 

 

 

+3

b3

msbyte

Figure 4-12 Store word, little-endian

If strict alignment fault checking is enabled and Address bits [1:0] are not zero, then a Data

Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.13Store word, big-endian

The 32-bit general-purpose register is stored to four bytes in memory where bits [31:24] of the ARM register are transferred to the most-significant addressed byte in memory, as Figure 4-13 on page 4-12 shows.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

4-11

ID012410

Non-Confidential, Unrestricted Access

 

 

 

 

 

Unaligned and Mixed-endian Data Access Support

 

 

Register

 

Memory

 

 

 

 

Address

7

0

 

 

 

 

A[31:0]

 

 

31

23

15

7

0

 

 

B0

 

B1

B2

B3

B0

msbyte

 

 

 

 

+1

B1

 

 

 

 

 

+2

B2

 

 

 

 

 

+3

B3

lsbyte

Figure 4-13 Store word, big-endian

If strict alignment fault checking is enabled and Address bits [1:0] are not zero, then a Data

Abort is generated and the MMU returns a Misaligned fault in the Fault Status Register.

4.3.14Load double, load multiple, load coprocessor (little-endian, E = 0)

The access is treated as a series of incrementing aligned word loads from memory. The data is treated as load word data, see Load word, little-endian on page 4-10, where the lowest two address bits are zeroed. If strict alignment fault checking is enabled and effective Address bits[1:0] are not zero, then a Data Abort is generated and the MMU returns an Alignment fault in the Fault Status Register.

4.3.15Load double, load multiple, load coprocessor (big-endian, E=1)

The access is treated as a series of incrementing aligned word loads from memory. The data is treated as load word data, see Load word, big-endian on page 4-11, where the lowest two address bits are zeroed. If strict alignment fault checking is enabled and effective Address bits[1:0] are not zero, then a Data Abort is generated and the MMU returns an Alignment fault in the Fault Status Register.

4.3.16Store double, store multiple, store coprocessor (little-endian, E=0)

The access is treated as a series of incrementing aligned word stores to memory. The data is treated as store word data, see Store word, little-endian on page 4-11, where the lowest two address bits are zeroed. If strict alignment fault checking is enabled and effective Address bits[1:0] are not zero, then a Data Abort is generated and the MMU returns an Alignment fault in the Fault Status Register.

4.3.17Store double, store multiple, store coprocessor (big-endian, E=1)

The access is treated as a series of incrementing aligned word stores to memory. The data is treated as store word data, see Store word, big-endian, where the lowest two address bits are zeroed. If strict alignment fault checking is enabled and effective Address bits[1:0] are not zero, then a Data Abort is generated and the MMU returns an Alignment fault in the Fault Status Register.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

4-12

ID012410

Non-Confidential, Unrestricted Access

 

Соседние файлы в папке ARM