Managing Memory and Data Access
16.4 Using Alignment Directives, Qualifiers, and Flags
Byte Layout for Example 16–5:
|REC1
|
|FLD1
|FLD2
|FLD3
|
|FLD1-1 |FLD1-2
|
|*|
|FLD3-2 |FLD3-3
|
|
|
|
| |f f f|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1
5
12
17
21
25
Begin byte number (starting with 0)
Record length is 29 bytes.
Notes:
The asterisk (*) designates FLD3-1.
The letter f designates internal filler bytes produced because the field
FLD3-2 has to start on the boundary that is the next higher multiple of
4 because it is longword-aligned. The intervening three bytes following
FLD3-1 are skipped over.
Example 16–6 Data Map for /ALIGNMENT=PADDING, -align pad
Source Listing
Data Names in Declared Order
Line
Level
Name
Location
Size
Bytes Usage
Category
----
-----
-------
------------
-----
----- --------
--------
7
01
REC1
2
00000000
36
36
DISPLAY
Group
8
02
FLD1
2
00000000
12
12
DISPLAY
Group
9
03
FLD1-1
2
00000000
9
4
COMP
N
10
03
FLD1-2
2
00000004
7
7
DISPLAY
N
11
02
FLD2
2
0000000C
5
5
DISPLAY
AN
12
02
FLD3
2
00000014
16
16
DISPLAY
Group
13
03
FLD3-1
2
00000014
1
1
DISPLAY
AN
14
03
FLD3-2
2
00000018
9
4
COMP
N
15
03
FLD3-3
2
0000001C
5
5
DISPLAY
N
Byte Layout for Example 16–6:
|REC1
|FLD1
|FLD2
|FLD3
|
|FLD1-1 |FLD1-2
(1)|
| (2) |*|
|FLD3-2 |FLD3-3
| (3) |
|
|
|p|
|p p p| |f f f|
|
|p p p|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1
5
13
18
21
25
29
34
36
Begin byte number (starting with 0)
Record length is 36 bytes.
1.
This pad byte brings substructure FLD1 up to:
12 = 3 * 4 bytes - multiple of longword alignment
2.
These three pad bytes are skipped over. They are required because FLD3, the
next substructure, has to start on a longword boundary because it contains
FLD3-2.
FLD2 contains five bytes and is padded three bytes out to eight.
16–12 Managing Memory and Data Access
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......