Home > Archive > Cobol > July 2004 > Synchronized (not SLACK)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Synchronized (not SLACK)
|
|
| William M. Klein 2004-07-30, 3:55 am |
| As a follow-up on another thread (and somewhat as a correction to what I
posted), the 2002 Standard does not (at least at quick glance) use the term
"slack" (for bytes or bits inserted within records). The following is the
entire text of what I was trying to explain when I originally commented that an
file with a record layout might have "unexpected garbage" between fields.
From page 110 of the 2002 Standard,
"
8.5.1.5.4 Item alignment for increased object-code efficiency
Some computer memories are organized in such a way that there are natural
addressing boundaries in the computer memory, such as word boundaries, half-word
boundaries, and byte boundaries. The way in which data is stored is determined
by the runtime module, and need not respect these natural boundaries.
However, certain uses of data in such constructs as arithmetic operations or
subscripting may be facilitated if the data is stored so as to be aligned on
these natural boundaries. Specifically, additional machine operations might be
required at execution time for the accessing and storage of data if portions of
two or more data items appear between adjacent natural boundaries, or if certain
natural boundaries bifurcate a single data item.
Data items that are aligned on these natural boundaries in such a way as to
avoid such additional machine operations are defined to be synchronized.
Synchronization can be accomplished in two ways:
1) By use of the SYNCHRONIZED clause.
2) By recognizing the appropriate natural boundaries and organizing the data
suitably without the use of the SYNCHRONIZED clause.
Each implementor who provides for special types of alignment shall specify the
precise interpretations that are to be made. The use of such items within a
group may affect the results of statements in which the group is used as an
operand. Each implementor who provides for these special types of alignment
shall describe the effect of the implicit FILLER and the semantics of any
statement referencing these groups."
--
Bill Klein
wmklein <at> ix.netcom.com
| |
| Chuck Stevens 2004-07-30, 3:55 pm |
|
"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:UNjOc.2772$cK.402@newsread2.news.pas.earthlink.net...
> As a follow-up on another thread (and somewhat as a correction to what I
> posted), the 2002 Standard does not (at least at quick glance) use the
term
> "slack" (for bytes or bits inserted within records).
In a sense you're right, at least as far as "normative" specifications go.
However, the term "slack bits or bytes" does appear in ISO/IEC 1989:2002 in
two NOTEs, one on Page 404 in the subject 14.7.1, Parameters, and the other
on Page 407 in the topic 14.7.2.1, Group items, under the subject 14.7.2,
Returning items.
-Chuck Stevens
|
|
|
|
|