Interrupt 17-alignment check exception (#ac), Interrupt 17—alignment check exception (#ac) – Intel IA-32 User Manual
Page 233
Vol. 3A 5-57
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 alignment-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 5-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-protection 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.
•
AC flag in the EFLAGS register is set.
•
The CPL is 3 (protected mode or virtual-8086 mode).
Table 5-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.