EasyManuals Logo
Home>IBM>Computer Hardware>PowerPC 405GP

IBM PowerPC 405GP User Manual

IBM PowerPC 405GP
668 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #110 background imageLoading...
Page #110 background image
3.5.1
Structure
Mapping Examples
The following C language structure,
8,
contains an assortment
of
scalars and a character string.
The
comments show the value assumed to be
in
each structure element; these values
show
how the
bytes comprising each structure
element are mapped into storage.
struct {
inta;
I*Ox1112_1314word*/
long long
b;
1*
OX2122_2324_2526_2728 doubleword
*/
char
*c; /* Ox3132_3334 word
*/
char
d[7];
1*
'A','B','C','O"'E','F','G' array
of
bytes
*/
short
e;
1*
Ox5152 halfword
*/
int
f;
1*
Ox6162_6364 word
*/
} s;
C structure mapping rules permit the use of padding (skipped bytes) to align scalars on desirable
boundaries.
The
structure mapping examples
show
each scalar aligned at its natural boundary. This
alignment introduces padding
of
four bytes between a and
b,
one byte between d and
e,
and two
bytes between e and
f.
The
same amount of padding is present in both big end ian and little endian
mappings.
3.5.1.1
Big Endian Mapping
The
big endian mapping of structure 8 follows. (The data is highlighted in the structure mappings.
Addresses, in
hexadecimal, are below the data stored at the address.
The
contents of each byte, as
defined in structure
8,
is shown as a (hexadecimal) number
or
character (for the string elements).
11
12
13 14
OxOO
Ox01
Ox02
Ox03 Ox04 Ox05 Ox06
Ox07
21
22 23
24
25
26
27
28
Ox08
Ox09
OxOA
OxOS
Oxoc
OxOD
OxOE
OxOF
31
32
33
34 'A' 'B'
'e'
'0'
Ox10
Ox11
Ox12
Ox13
Ox14
Ox15
Ox16
Ox17
'E' 'F'
'G'
51
52
Ox18 Ox19
Ox1A
Ox1S
Ox1C
Ox1D
Ox1E
Ox1F
61
62
63
64
Ox20
Ox21
Ox22
Ox23
Ox24
Ox25 Ox26
Ox27
Preliminary Programming Model 3-29

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM PowerPC 405GP and is the answer not in the manual?

IBM PowerPC 405GP Specifications

General IconGeneral
BrandIBM
ModelPowerPC 405GP
CategoryComputer Hardware
LanguageEnglish

Related product manuals