Intel i960 User Manual page 195

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

7
7-6
i960 Processor Compiler User's Guide
Structure alignment can result in unused space, called padding, between
members of the structure and between the last member and the end of the
space occupied by the structure. The padding at the end of the structure is
called tail padding. Because of differences in padding under different
alignments, changing the alignment can change both the size of the
structure and the offsets of members relative to the beginning of the
structure.
The offset of a structure member from the beginning of the structure is as
follows:
Under both forms of natural alignment, the offset of a structure
member is a multiple of the member's natural alignment. For
example, since a
short
member from the beginning of a structure is a multiple of
short
2 bytes.
Under user-constrained alignment, the offset of a structure member is
a multiple of the lesser of the member's alignment or the alignment
constraint you specify.
For example, in a 1-byte alignment (
member is not necessarily even.
The rules for structure member natural alignment are:
Scalar types
Array types
aligns on a 2-byte boundary, the offset of a
noalign
align according to their natural architectural
alignment. For example, a
aligns on a 2-byte boundary.
align according to the alignment of the array
elements. For example, an array of
type aligns on a 2-byte boundary.
), the offset of a
short
data type
short
data
short

Advertisement

Table of Contents
loading

Table of Contents