6-60 Vol. 3
INTERRUPT AND EXCEPTION HANDLING
Interrupt 17—Alignment Check Exception (#AC)
Exception Class Fault.
Description
Indicates that the processor detected an unaligned memory operand when alignment
checking was enabled. Alignment checks are only carried out in data (or stack)
accesses (not in code fetches or system segment accesses). An example of an align
-
ment-check violation is a word stored at an odd byte address, or a doubleword stored
at an address that is not an integer multiple of 4.
Table 6-7 lists the alignment
requirements various data types recognized by the processor.
Note that the alignment check exception (#AC) is generated only for data types that
must be aligned on word, doubleword, and quadword boundaries. A general-protec-
tion exception (#GP) is generated 128-bit data types that are not aligned on a
16-byte boundary.
To enable alignment checking, the following conditions must be true:
• AM flag in CR0 register is set.
Table 6-7. Alignment Requirements by Data Type
Data Type Address Must Be Divisible By
Word 2
Doubleword 4
Single-precision floating-point (32-bits) 4
Double-precision floating-point (64-bits) 8
Double extended-precision floating-point (80-
bits)
8
Quadword 8
Double quadword 16
Segment Selector 2
32-bit Far Pointer 2
48-bit Far Pointer 4
32-bit Pointer 4
GDTR, IDTR, LDTR, or Task Register Contents 4
FSTENV/FLDENV Save Area 4 or 2, depending on operand size
FSAVE/FRSTOR Save Area 4 or 2, depending on operand size
Bit String 2 or 4 depending on the operand-size attribute.