HP 3000 Manuals

HP3000_16 Directive [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

HP3000_16 Directive 

The HP3000_16 directive:

   *   allows MPE/iX programs to correctly access MPE V data files that
       contain floating point data

   *   aligns noncharacter data on 16-bit boundaries and character data
       on 8-bit boundaries, as on MPE V

   *   performs character moves the same as on MPE V when there is an
       overlapping character substring that should ripple across

Syntax 

           [ON         ]
           [OFF        ]
$HP3000_16 [ALIGNMENT  ]
           [REALS      ]
           [STRING_MOVE]

-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
|       Item        |            Description             |            Restrictions            |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| ON                | Turns on ALIGNMENT, REALS, and     | None.                              |
|                   | STRING_MOVE options.               |                                    |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| OFF               | Turns off ALIGNMENT, REALS, and    | For accessing IEEE floating point  |
|                   | STRING_MOVE options.               | data with no assumptions of MPE V  |
|                   |                                    | data layout and rippling           |
|                   |                                    | overlapping character substrings.  |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| ALIGNMENT         | Aligns noncharacter data on 16-bit | Not for accessing MPE V floating   |
|                   | boundaries.                        | point numbers or rippling          |
|                   |                                    | overlapping character substrings.  |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| REALS             | For accessing MPE V floating point | Makes no assumptions of MPE V data |
|                   | numbers.                           | alignment and rippling overlapping |
|                   |                                    | character substrings.              |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| STRING_MOVE       | Performs a byte-by-byte move of a  | Makes no assumptions of MPE V data |
|                   | character substring when a         | alignment or the format of the     |
|                   | character substring is assigned to | floating point data.               |
|                   | another character substring and    |                                    |
|                   | the substrings overlap.            |                                    |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------

MPE V and MPE/iX have different data alignments, as summarized in Table
7-3 .

          Table 7-3.  Data Alignment on MPE V and MPE/iX 

-------------------------------------------------------------------------------------------------
|             |                                        |                                        |
|  Alignment  |                 MPE V                  |                 MPE/iX                 |
|             |                                        |                                        |
-------------------------------------------------------------------------------------------------
|             |                                        |                                        |
| 8-bit       | CHARACTER                              | CHARACTER                              |
|             |                                        |                                        |
-------------------------------------------------------------------------------------------------
|             |                                        |                                        |
| 16-bit      | COMPLEX*8, COMPLEX*16                  | INTEGER*2                              |
|             | INTEGER*2, INTEGER*4                   | LOGICAL*2                              |
|             | LOGICAL*2, LOGICAL*4                   |                                        |
|             | REAL*4, REAL*8, REAL*16                |                                        |
|             |                                        |                                        |
-------------------------------------------------------------------------------------------------
|             |                                        |                                        |
| 32-bit      |                                        | COMPLEX*8                              |
|             |                                        | INTEGER*4                              |
|             |                                        | LOGICAL*4                              |
|             |                                        | REAL*4                                 |
|             |                                        |                                        |
-------------------------------------------------------------------------------------------------
|             |                                        |                                        |
| 64-bit      |                                        | COMPLEX*16                             |
|             |                                        | REAL*8, REAL*16                        |
|             |                                        |                                        |
-------------------------------------------------------------------------------------------------

Default               Off.  Specify OFF or do not use the directive when
                      your program uses IEEE floating point data (as
                      opposed to MPE V floating point data), when your
                      program does not rely on MPE V data layout, and
                      when the ripple effect of overlapping character
                      substrings is not necessary.

Location              The HP3000_16 directive must appear before any
                      nondirective statement in a program unit.

Toggling/ Duration    Exercise caution when changing the directive
                      between program units of a single program because
                      mixing MPE V and MPE/iX real numbers gives
                      incorrect results and using COMMON and EQUIVALENCE
                      variables might produce unpredictable results if
                      you mix MPE V and MPE/iX alignment.

Impact on             Use the ON option only when your program accesses
Performance           MPE V floating point data, when you need data
                      aligned as on MPE V, and when you are assigning a
                      character substring to another character substring
                      and the substrings overlap by one character.  Of
                      all the options, the ON option causes the greatest
                      degradation in program performance.

                      The STRING_MOVE option has a performance
                      degradation on all character substring moves that
                      overlap because the compiler cannot generate code
                      for a fast move.

Additional Information 

The ON option turns on the ALIGNMENT, REALS, and STRING_MOVE options.

The ALIGNMENT option aligns data on 16-bit boundaries, rather than on the
MPE/iX boundaries shown in Table 7-3 .  Use this option only if you
require the preceding condition and if your program does not access files
containing MPE V floating point numbers or rippling overlapping character
substrings is not necessary.  If your program accesses MPE V floating
point numbers, or requires rippling overlapping character substrings, use
the REALS or STRING_MOVE option.  Use this option when you need to rely
on EQUIVALENCE and COMMON specifications for MPE data layout, as when
calling database intrinsics.

The REALS option reads, writes, and executes floating point numbers in
MPE V representation, rather than using IEEE floating point standards (as
used on MPE/iX). Use this option only if you require the preceding
condition and if your program makes no assumptions on data alignment or
rippling overlapping character substrings.  If you require 16-bit data
alignment, use the ON or ALIGNMENT option.

The STRING_MOVE option performs a byte-by-byte move whenever a character
substring is assigned to another character substring and the substrings
overlap.  Use this option if your program expects the characters to be
rippled across.

Example 

     .
     .
     CHARACTER*10 ch
     .
     .
     .
     ch = "*         "
     ch[2:10] = ch[1:9]

After the assignment on MPE V, ch contains the following:

     **********

On MPE/iX without using the STRING_MOVE option, ch contains the
following:

     ** Delta  Delta  Delta  Delta  Delta  Delta  Delta  Delta

where Delta  represents a blank.

Refer to the HP FORTRAN 77/iX Programmer's Guide for more details on this
directive.



MPE/iX 5.0 Documentation