beautypg.com

Little-endian, Data extraction using sequential halfword access – NEC Network Controller uPD98502 User Manual

Page 228

background image

CHAPTER 3 SYSTEM CONTROLLER

228

Preliminary User’s Manual S15543EJ1V0UM

However, when making half-word accesses into a data array consisting of word data, access to the more-

significant half word requires the address corresponding to the less significant half word (and vice versa). Such code

is not endian-independent. A super-group access (for example, accessing two half words simultaneously as a word

from a half-word data array) causes the same problem. Such problems also arise when a half-word access is made

into a 32-bit register, whereas a word access into a 32-bit register creates no problem.

Figure 3-3. Word Data Array Example

W o r d

D a t a A r r a y

Big-Endian

Data extraction using sequential halfword access

W 1

W 0

L S H W

M S H W

Little-Endian

M S H W

L S H W

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Order Retained

Data extraction using sequential halfword access

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Order Lost

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

W 1

W 0

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P