Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Pascal/HP-UX Programmer's Guide > Chapter 5 Allocation and Alignment

Introduction

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

This chapter:

  • Defines allocation, alignment, and packing algorithm.

  • Shows how unpacked and packed variables are allocated and aligned.

  • Tells how entire arrays and records are allocated and aligned (whether they are unpacked, packed, or crunched).

  • Shows how array elements and record fields are allocated and aligned when they are unpacked, packed, and crunched.

  • Explains how enumeration and subrange types are related and shows how they are allocated and aligned.

  • Explains how files, sets, and strings are allocated and aligned.

NOTE: This chapter applies to the HP Pascal packing algorithm, which is the default. On the MPE/iX operating system, the compiler option HP3000_16 specifies the Pascal/V packing algorithm instead. For information on the HP3000_16 compiler option, refer to the HP Pascal/iX Reference Manual. For information on the Pascal/V packing algorithm, see Appendix A “MPE/iX Dependencies ” in this manual.

In diagrams in this section, bold lines are byte boundaries and fine lines are bit boundaries. Unused bits and bytes are shaded.

Figure 5-1 Allocation and Alignment Example 1

Allocation and Alignment Example 1

Note that:

  • Zero represents the Boolean value FALSE, and one represents TRUE.

  • The leftmost bit represents the sign of a signed integer value.

Byte boundaries are broken where a variable crosses them. Bit boundaries are omitted where a variable crosses them. A space that is allocated to a variable contains the variable's name. If the name does not fit the space, it is printed outside, with an arrow pointing to the space.

Figure 5-2 Allocation and Alignment Example 2

Allocation and Alignment Example 2

The variables a and b occupy one bit each, c occupies six bits, d and e occupy two bytes each, f occupies three bytes, and g occupies eight bytes.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.