Intel 64 and IA-32 Architectures Software Developers Manual Volume 1, Basic Architecture

4-2 Vol. 1
DATA TYPES
Figure 4-2 shows the byte order of each of the fundamental data types when refer-
enced as operands in memory. The low byte (bits 0 through 7) of each data type
occupies the lowest address in memory and that address is also the address of the
operand.
4.1.1 Alignment of Words, Doublewords, Quadwords, and Double
Quadwords
Words, doublewords, and quadwords do not need to be aligned in memory on natural
boundaries. The natural boundaries for words, double words, and quadwords are
even-numbered addresses, addresses evenly divisible by four, and addresses evenly
divisible by eight, respectively. However, to improve the performance of programs,
data structures (especially stacks) should be aligned on natural boundaries when-
ever possible. The reason for this is that the processor requires two memory
accesses to make an unaligned memory access; aligned accesses require only one
memory access. A word or doubleword operand that crosses a 4-byte boundary or a
quadword operand that crosses an 8-byte boundary is considered unaligned and
requires two separate memory bus cycles for access.
Figure 4-2. Bytes, Words, Doublewords, Quadwords, and Double Quadwords in
Memory
EH
DH
7AH
CH
FEH
BH
06H
AH
36H
9H
1FH
8H
A4H
7H
23H
6H
0BH
5H
4H
3H
74H
2H
CBH
1H
31H
0H
Quadword at Address 6H
Contains
Doubleword at Address AH
Contains 7AFE0636H
Word at Address BH
Contains FE06H
Byte at Address 9H
Contains 1FH
Word at Address 6H
Contains 230BH
Word at Address 1H
Contains CB31H
Word at Address 2H
Contains 74CBH
Double quadword at Address 0H
45H
67H
12H
Contains
12H
7AFE06361FA4230BH
127AFE06361FA4230B456774CB3112H