HP3000-L Archives

January 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Keven Miller <[log in to unmask]>
Reply To:
Keven Miller <[log in to unmask]>
Date:
Mon, 5 Jan 1998 09:09:28 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (64 lines)
You can refer to chapter 9 in the HP C/iX Reference Manual, under Data
Alignment Pragma.  There is
a #pragma HP_ALIGN MPE_16.

********************
* Keven Miller   KC7LYD
* [log in to unmask]   (Salt Lake City, Utah, USA)
********************

Data Alignment Pragma

This section discusses the HP_ALIGN data alignment pragma and the
differences between the data alignment architectures of the MPE/iX and
MPE/V systems.

The HP_ALIGN data alignment pragma allows you to control the alignment
of
fields within structures and unions.  It facilitates the interchange of
data between MPE systems having different data alignment architectures.

Data alignment architectures specify the number of bits allocated to
store various data types, whether a data type is aligned on a byte,
two-byte, word, or double word boundary, and padding among bit-fields.
The differences in data alignment architectures are especially important
to consider when passing data from one machine to another.

The HP_ALIGN pragma facilitates transferring data among MPE V and MPE/iX
systems and when accessing TurboImage databases from HP C/iX.

The syntax for the HP_ALIGN pragma is:


#pragma HP_ALIGN {MPE_16}
                 {POP   }

The MPE_16 option directs the HP C/iX compiler to set the alignment of
int, float, and double in structures and unions to be aligned according
to the MPE/V alignment scheme.  This option also sets the alignment of
structures and unions to start and end on at least a half-word boundary.

The POP option turns off the HP_ALIGN pragma and alignment reverts to
word (32-bit) alignment.

...
The differences between the HP_ALIGN MPE_16 and the native MPE/iX
alignments are:


   *   MPE/V aligned records are aligned on a 2-byte boundary.  MPE/iX
       aligned records are aligned according to the most restrictive
data
       type within the structure.

   *   MPE/V aligned doubles are 2-byte aligned.  MPE/iX aligned doubles
       are 8-byte aligned within structures.

   *   MPE/V aligned long doubles, available in ANSI mode only, are
       2-byte aligned.  MPE/iX aligned long doubles are 8-byte aligned
       within structures.

   *   MPE/V aligned enumerated data types are 2-byte aligned in a
       structure, array, or union.  MPE/iX aligned enumerated types are
       always 4-byte aligned.

ATOM RSS1 RSS2