HP 3000 Manuals

Addressing Mode [ HP FORTRAN 77/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Programmer's Guide

Addressing Mode 

The FORTRAN compiler generates machine instructions that access program
data.  Depending on the type of the data, the instructions use any of the
modes of addressing shown in Table 1-2 .

          Table 1-2.  Addressing Mode 

--------------------------------------------------------------------------------------------
|                       |                                                                  |
|    Addressing Mode    |                           Description                            |
|                       |                                                                  |
--------------------------------------------------------------------------------------------
|                       |                                                                  |
|        Direct         | Accesses data directly by using the address given to the         |
|                       | variable.                                                        |
|                       |                                                                  |
--------------------------------------------------------------------------------------------
|                       |                                                                  |
|       Indirect        | Accesses data by using a pointer to the address of the data.     |
|                       |                                                                  |
--------------------------------------------------------------------------------------------
|                       |                                                                  |
|      Descriptor       | Accesses data by using a record containing the address of the    |
|                       | data and the maximum length.                                     |
|                       |                                                                  |
--------------------------------------------------------------------------------------------

Direct addressing saves both storage and time.  Indirect addressing
requires an extra pointer in addition to the regular variable storage.
Descriptor addressing requires multiple words, including a pointer and
the maximum length of the data item; the number of words is machine
dependent.  The access mode is determined by the data class, as
summarized in Table 1-3 .

          Table 1-3.  Data Class and Addressing Mode 

-------------------------------------------------------------------------------
|                                                     |                       |
|                     Data Class                      |    Addressing Mode    |
|                                                     |                       |
-------------------------------------------------------------------------------
|                                                     |                       |
| Common variables.                                   | Indirect              |
|                                                     |                       |
-------------------------------------------------------------------------------
|                                                     |                       |
| Static variables (variables in a SAVE or DATA statement).irect              |
|                                                     |                       |
-------------------------------------------------------------------------------
|                                                     |                       |
| Variables in an EQUIVALENCE statement.              | Direct and indirect   |
|                                                     |                       |
-------------------------------------------------------------------------------
|                                                     |                       |
| Local variables not in a SAVE or DATA statement.    | Direct                |
|                                                     |                       |
-------------------------------------------------------------------------------
|                                                     |                       |
| Parameters:                                         | By descriptor         |
| Character string parameters                         | Indirect              |
| Other parameters                                    |                       |
|                                                     |                       |
-------------------------------------------------------------------------------
|                                                     |                       |
| Other variables                                     | Direct                |
|                                                     |                       |
-------------------------------------------------------------------------------


NOTE Make sure all variables are properly initialized. HP Link Editor/iX does not initialize all the stack space as the Segmenter on MPE V does. Uninitialized variables that do not cause problems on MPE V/E-based systems might cause programs to abort on MPE/iX-based systems. HP FORTRAN 77/V stores variables larger than eight bytes indirectly; HP FORTRAN 77/iX stores the variables directly.


MPE/iX 5.0 Documentation