Hardware Reference
In-Depth Information
provide access for bytes (8 bits), half words (16 bits), and words (32 bits). Most of the com-
puters also provide access for double words (64 bits).
There are two different conventions for ordering the bytes within a larger object.
Litle Endi-
an
byte order puts the byte whose address is “x … x000” at the least-significant position in the
double word (the litle end). The bytes are numbered:
Big Endian
byte order puts the byte whose address is “x … x000” at the most-significant po-
sition in the double word (the big end). The bytes are numbered:
When operating within one computer, the byte order is often unnoticeable—only programs
that access the same locations as both, say, words and bytes, can notice the difference. Byte or-
der is a problem when exchanging data among computers with different orderings, however.
Litle Endian ordering also fails to match the normal ordering of words when strings are com-
pared. Strings appear “SDRAWKCAB” (backwards) in the registers.
A second memory issue is that in many computers, accesses to objects larger than a byte
must be
aligned
. An access to an object of size
s
bytes at byte address
A
is aligned if
A
mod
s =
0.
Figure A.5
shows the addresses at which an access is aligned or misaligned.
Search WWH ::
Custom Search